diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 92c976f55d4..755ca996a15 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -21,7 +21,7 @@ jobs: build: name: Gradle tests runs-on: ubuntu-latest - container: gradle:jdk8 + container: gradle:jdk11 strategy: fail-fast: true matrix: @@ -37,7 +37,7 @@ jobs: - uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 8 + java-version: 11 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache uses: actions/cache@v2 diff --git a/README.md b/README.md index e993fdf0fb2..5774c216447 100644 --- a/README.md +++ b/README.md @@ -589,6 +589,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Bithost GmbH](https://www.bithost.ch) - [Bosch Connected Industry](https://www.bosch-connected-industry.com) - [Boxever](https://www.boxever.com/) +- [Bunker Holding Group](https://www.bunker-holding.com/) - [California State University, Northridge](https://www.csun.edu) - [CAM](https://www.cam-inc.co.jp/) - [Camptocamp](https://www.camptocamp.com/en) @@ -650,6 +651,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Ponicode](https://ponicode.dev/) - [Pricefx](https://www.pricefx.com/) - [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager) +- [Qavar](https://www.qavar.com) - [QEDIT](https://qed-it.com) - [Qulix Systems](https://www.qulix.com) - [Raksul](https://corp.raksul.com) diff --git a/appveyor.yml b/appveyor.yml index bd3df29e020..b415f595021 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ install: Add-Type -AssemblyName System.IO.Compression.FileSystem if (!(Test-Path -Path "C:\maven" )) { (new-object System.Net.WebClient).DownloadFile( - 'http://www.us.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip', + 'https://archive.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.zip', 'C:\maven-bin.zip' ) [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven") @@ -22,15 +22,15 @@ install: ) [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\gradle-bin.zip", "C:\gradle") } - - cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;C:\gradle\gradle-5.6.4\bin;%JAVA_HOME%\bin;%PATH% + - cmd: SET PATH=C:\maven\apache-maven-3.8.3\bin;C:\gradle\gradle-5.6.4\bin;%JAVA_HOME%\bin;%PATH% - cmd: SET MAVEN_OPTS=-Xmx4g - cmd: SET JAVA_OPTS=-Xmx4g - - cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5 + - cmd: SET M2_HOME=C:\maven\apache-maven-3.8.3 - cmd: java -version - cmd: gradle -v - cmd: dir/w - git clone https://github.com/wing328/swagger-samples --depth 1 - - ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci" + - ps: Start-Process -FilePath 'C:\maven\apache-maven-3.8.3\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci" - ps: Start-Sleep -s 15 - ps: $PSVersionTable.PSVersion - ps: Install-Module -Name Pester -Force -Scope CurrentUser diff --git a/bin/configs/csharp-netcore-complex-files.yaml b/bin/configs/csharp-netcore-complex-files.yaml new file mode 100644 index 00000000000..b67cece1ad1 --- /dev/null +++ b/bin/configs/csharp-netcore-complex-files.yaml @@ -0,0 +1,10 @@ +generatorName: csharp-netcore +outputDir: samples/client/others/csharp-netcore-complex-files +inputSpec: modules/openapi-generator/src/test/resources/3_0/form-multipart-binary-array.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + targetFramework: netstandard2.0 + useCompareNetObjects: "true" +globalProperties: + skipFormModel: "false" diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index a6f310fe2bd..9026c07afbd 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -79,6 +79,7 @@ declare -a xml_files=( "${root}/modules/openapi-generator-online/pom.xml" "${root}/modules/openapi-generator/pom.xml" "${root}/modules/openapi-generator-gradle-plugin/gradle.properties" + "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 0dcbd968233..96be28abb0a 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -236,10 +236,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 |BearerToken|✓|OAS3 -|OAuth2_Implicit|✗|OAS2,OAS3 -|OAuth2_Password|✗|OAS2,OAS3 -|OAuth2_ClientCredentials|✗|OAS2,OAS3 -|OAuth2_AuthorizationCode|✗|OAS2,OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 ### Wire Format Feature | Name | Supported | Defined By | diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 7e056315f61..3727fc6fdf6 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -13,7 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactId|artifactId| |openapi-scala-akka-http-server| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |asManagedSources|Resulting files cab be used as managed resources. No build files or default controllers will be generated| |false| -|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (prefered for JDK 1.8+)
|java8| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index 683fbef2167..f2c9cecdab9 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 414715926d2..2477cb6848e 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 15bf6f6e26f..adf4649ffcc 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 8dc2075e377..8c583afcaac 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index a0cd2044ea1..0e12f7695d4 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -10,7 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| |circeVersion|The version of circe library| |0.13.0| -|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (prefered for JDK 1.8+)
|java8| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |jodaTimeVersion|The version of joda-time library| |2.10.10| diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index a7a657bce95..aab1bd98c22 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 41b6240df6d..87dc8b0e5e4 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 5515eaae9bc..8f834fdf27d 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| +|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -69,6 +70,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| |useBeanValidation|Use BeanValidation API annotations| |true| |useOptional|Use Optional container for optional parameters| |false| +|useSpringController|Annotate the generated API as a Spring Controller| |false| |useTags|use tags for creating interface and controller classnames| |false| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 126ccd5ae38..ab8b3da35fc 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| -|ngVersion|The version of Angular. (At least 6.0.0)| |12.0.0| +|ngVersion|The version of Angular. (At least 6.0.0)| |12.2.12| |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| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 3a235af7f7c..8193e20e3f4 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -86,7 +86,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand { "--markdown-header"}, title = "markdown header", description = "When format=markdown, include this option to write out markdown headers (e.g. for docusaurus).") private Boolean markdownHeader; - @Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --supporting-files)") + @Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --feature-set)") private Boolean fullDetails; private String newline = System.lineSeparator(); diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java index 496e078a15d..5b013006739 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java @@ -22,7 +22,9 @@ import org.apache.commons.lang3.ArrayUtils; import org.mockito.MockSettings; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.Generator; +import org.openapitools.codegen.SpecValidationException; import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.TestException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -430,4 +432,12 @@ public class GenerateTest { verify(configurator).toContext(); verifyNoMoreInteractions(configurator); } + + /** + * This test ensures that when the + */ + @Test(expectedExceptions = SpecValidationException.class) + public void testNPEWithInvalidSpecFile() { + setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null); + } } diff --git a/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml b/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml new file mode 100644 index 00000000000..3e2a60862c9 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml @@ -0,0 +1,14 @@ +test: + get: + responses: + '200': + description: test + content: + application/json: + schema: + type: object + properties: + prop1: + type: array + prop2: + type: date \ No newline at end of file diff --git a/modules/openapi-generator-cli/src/test/resources/npe-test.yaml b/modules/openapi-generator-cli/src/test/resources/npe-test.yaml new file mode 100644 index 00000000000..11fc1eff666 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/npe-test.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.0 +info: + description: test + version: test + title: test +paths: + /test: + $ref: 'npe-test-spec-file.yaml#/test' \ No newline at end of file diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 4da9eca486b..0d00f845a96 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.0-SNAPSHOT +openApiGeneratorVersion=5.3.1-SNAPSHOT # /RELEASE_VERSION diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java index 6c552a97b80..64cd2fe921e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java @@ -45,7 +45,7 @@ public class CodegenConfigLoader { try { return (CodegenConfig) Class.forName(name).getDeclaredConstructor().newInstance(); } catch (Exception e) { - throw new GeneratorNotFoundException("Can't load config class with name '".concat(name) + "'\nAvailable:\n" + availableConfigs.toString(), e); + throw new GeneratorNotFoundException("Can't load config class with name '".concat(name) + "'\nAvailable:\n" + availableConfigs, e); } } 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 0a44812ceac..39e7f784cc9 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 @@ -45,9 +45,9 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public List children; // anyOf, oneOf, allOf - public Set anyOf = new TreeSet(); - public Set oneOf = new TreeSet(); - public Set allOf = new TreeSet(); + public Set anyOf = new TreeSet<>(); + public Set oneOf = new TreeSet<>(); + public Set allOf = new TreeSet<>(); // The schema name as written in the OpenAPI document. public String name; @@ -66,20 +66,20 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public boolean isAlias; // Is this effectively an alias of another simple type public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isShort, isUnboundedInteger, isBoolean; private boolean additionalPropertiesIsAnyType; - public List vars = new ArrayList(); // all properties (without parent's properties) - public List allVars = new ArrayList(); // all properties (with parent's properties) - public List requiredVars = new ArrayList(); // a list of required properties - public List optionalVars = new ArrayList(); // a list of optional properties - public List readOnlyVars = new ArrayList(); // a list of read-only properties - public List readWriteVars = new ArrayList(); // a list of properties for read, write - public List parentVars = new ArrayList(); + public List vars = new ArrayList<>(); // all properties (without parent's properties) + public List allVars = new ArrayList<>(); // all properties (with parent's properties) + public List requiredVars = new ArrayList<>(); // a list of required properties + public List optionalVars = new ArrayList<>(); // a list of optional properties + public List readOnlyVars = new ArrayList<>(); // a list of read-only properties + public List readWriteVars = new ArrayList<>(); // a list of properties for read, write + public List parentVars = new ArrayList<>(); public Map allowableValues; // Sorted sets of required parameters. - public Set mandatory = new TreeSet(); // without parent's required properties - public Set allMandatory = new TreeSet(); // with parent's required properties + public Set mandatory = new TreeSet<>(); // without parent's required properties + public Set allMandatory = new TreeSet<>(); // with parent's required properties - public Set imports = new TreeSet(); + public Set imports = new TreeSet<>(); public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation; /** * Indicates the OAS schema specifies "nullable: true". @@ -104,7 +104,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public boolean hasOnlyReadOnly = true; // true if all properties are read-only public ExternalDocumentation externalDocumentation; - public Map vendorExtensions = new HashMap(); + public Map vendorExtensions = new HashMap<>(); private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; @@ -320,7 +320,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public void setDiscriminator(CodegenDiscriminator discriminator) { this.discriminator = discriminator; - if (discriminator instanceof CodegenDiscriminator && !discriminator.getMappedModels().isEmpty()) { + if (discriminator != null && !discriminator.getMappedModels().isEmpty()) { this.hasDiscriminatorWithNonEmptyMapping = true; } } @@ -1067,13 +1067,13 @@ public class CodegenModel implements IJsonSchemaValidationProperties { private List removeDuplicatedProperty(List vars) { // clone the list first - List newList = new ArrayList(); + List newList = new ArrayList<>(); for (CodegenProperty cp : vars) { newList.add(cp.clone()); } - Set propertyNames = new TreeSet(); - Set duplicatedNames = new TreeSet(); + Set propertyNames = new TreeSet<>(); + Set duplicatedNames = new TreeSet<>(); ListIterator iterator = newList.listIterator(); while (iterator.hasNext()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 8d8e9cdc13e..ef348bbb266 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -225,9 +225,17 @@ public class CodegenOperation { /** * Check if body param is allowed for the request method * - * @return true request method is PUT, PATCH or POST; false otherwise + * @return true request method is DELETE, PUT, PATCH or POST; false otherwise */ public boolean isBodyAllowed() { + return Arrays.asList("DELETE","PUT", "PATCH", "POST").contains(httpMethod.toUpperCase(Locale.ROOT)); + } + /** + * Check if the request method is PUT or PATCH or POST + * + * @return true request method is PUT, PATCH or POST; false otherwise + */ + public boolean isMethodPutOrPatchOrPost() { return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase(Locale.ROOT)); } 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 dc67303aa9b..6e669ab37cd 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 @@ -147,8 +147,8 @@ public class DefaultCodegen implements CodegenConfig { protected Map typeMapping; protected Map instantiationTypes; protected Set reservedWords; - protected Set languageSpecificPrimitives = new HashSet(); - protected Map importMapping = new HashMap(); + protected Set languageSpecificPrimitives = new HashSet<>(); + protected Map importMapping = new HashMap<>(); protected String modelPackage = "", apiPackage = "", fileSuffix; protected String modelNamePrefix = "", modelNameSuffix = ""; protected String apiNamePrefix = "", apiNameSuffix = "Api"; @@ -159,25 +159,25 @@ public class DefaultCodegen implements CodegenConfig { apiTemplateFiles are for API outputs only (controllers/handlers). API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group. */ - protected Map apiTemplateFiles = new HashMap(); - protected Map modelTemplateFiles = new HashMap(); - protected Map apiTestTemplateFiles = new HashMap(); - protected Map modelTestTemplateFiles = new HashMap(); - protected Map apiDocTemplateFiles = new HashMap(); - protected Map modelDocTemplateFiles = new HashMap(); - protected Map reservedWordsMappings = new HashMap(); + protected Map apiTemplateFiles = new HashMap<>(); + protected Map modelTemplateFiles = new HashMap<>(); + protected Map apiTestTemplateFiles = new HashMap<>(); + protected Map modelTestTemplateFiles = new HashMap<>(); + protected Map apiDocTemplateFiles = new HashMap<>(); + protected Map modelDocTemplateFiles = new HashMap<>(); + protected Map reservedWordsMappings = new HashMap<>(); protected String templateDir; protected String embeddedTemplateDir; protected Map additionalProperties = new HashMap<>(); - protected Map serverVariables = new HashMap(); - protected Map vendorExtensions = new HashMap(); + protected Map serverVariables = new HashMap<>(); + protected Map vendorExtensions = new HashMap<>(); /* Supporting files are those which aren't models, APIs, or docs. These get a different map of data bound to the templates. Supporting files are written once. See also 'apiTemplateFiles'. */ - protected List supportingFiles = new ArrayList(); - protected List cliOptions = new ArrayList(); + protected List supportingFiles = new ArrayList<>(); + protected List cliOptions = new ArrayList<>(); protected boolean skipOverwrite; protected boolean removeOperationIdPrefix; protected String removeOperationIdPrefixDelimiter = "_"; @@ -210,7 +210,7 @@ public class DefaultCodegen implements CodegenConfig { */ protected boolean supportsAdditionalPropertiesWithComposedSchema; protected boolean supportsMixins; - protected Map supportedLibraries = new LinkedHashMap(); + protected Map supportedLibraries = new LinkedHashMap<>(); protected String library; protected Boolean sortParamsByRequiredFlag = true; protected Boolean sortModelPropertiesByRequiredFlag = false; @@ -222,7 +222,7 @@ public class DefaultCodegen implements CodegenConfig { // How to encode special characters like $ // They are translated to words like "Dollar" and prefixed with ' // Then translated back during JSON encoding and decoding - protected Map specialCharReplacements = new HashMap(); + protected Map specialCharReplacements = new HashMap<>(); // When a model is an alias for a simple type protected Map typeAliases = null; protected Boolean prependFormOrBodyParameters = false; @@ -236,7 +236,7 @@ public class DefaultCodegen implements CodegenConfig { protected boolean useOneOfInterfaces = false; // whether or not the oneOf imports machinery should add oneOf interfaces as imports in implementing classes protected boolean addOneOfInterfaceImports = false; - protected List addOneOfInterfaces = new ArrayList(); + protected List addOneOfInterfaces = new ArrayList<>(); // flag to indicate whether to only update files whose contents have changed protected boolean enableMinimalUpdate = false; @@ -260,7 +260,7 @@ public class DefaultCodegen implements CodegenConfig { private Map modelNameToSchemaCache; // A cache to efficiently lookup schema `toModelName()` based on the schema Key - private Map schemaKeyToModelNameCache = new HashMap<>(); + private final Map schemaKeyToModelNameCache = new HashMap<>(); @Override public List cliOptions() { @@ -440,7 +440,7 @@ public class DefaultCodegen implements CodegenConfig { // Gather data from all the models that contain oneOf into OneOfImplementorAdditionalData classes // (see docstring of that class to find out what information is gathered and why) - Map additionalDataMap = new HashMap(); + Map additionalDataMap = new HashMap<>(); for (Map.Entry modelsEntry : objs.entrySet()) { Map modelsAttrs = (Map) modelsEntry.getValue(); List models = (List) modelsAttrs.get("models"); @@ -503,7 +503,7 @@ public class DefaultCodegen implements CodegenConfig { * @return map of all models indexed by names */ public Map getAllModels(Map objs) { - Map allModels = new HashMap(); + Map allModels = new HashMap<>(); for (Entry entry : objs.entrySet()) { String modelName = toModelName(entry.getKey()); Map inner = (Map) entry.getValue(); @@ -823,9 +823,9 @@ public class DefaultCodegen implements CodegenConfig { public void preprocessOpenAPI(OpenAPI openAPI) { if (useOneOfInterfaces) { // we process the openapi schema here to find oneOf schemas and create interface models for them - Map schemas = new HashMap(openAPI.getComponents().getSchemas()); + Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); if (schemas == null) { - schemas = new HashMap(); + schemas = new HashMap<>(); } Map pathItems = openAPI.getPaths(); @@ -858,12 +858,12 @@ public class DefaultCodegen implements CodegenConfig { } // also add all properties of all schemas to be checked for oneOf - Map propertySchemas = new HashMap(); + Map propertySchemas = new HashMap<>(); for (Map.Entry e : schemas.entrySet()) { Schema s = e.getValue(); Map props = s.getProperties(); if (props == null) { - props = new HashMap(); + props = new HashMap<>(); } for (Map.Entry p : props.entrySet()) { propertySchemas.put(e.getKey() + "/" + p.getKey(), p.getValue()); @@ -1431,7 +1431,7 @@ public class DefaultCodegen implements CodegenConfig { public String toVarName(final String name) { if (reservedWords.contains(name)) { return escapeReservedWord(name); - } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) { + } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { return escape(name, specialCharReplacements, null, null); } return name; @@ -1449,7 +1449,7 @@ public class DefaultCodegen implements CodegenConfig { name = removeNonNameElementToCamelCase(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. if (reservedWords.contains(name)) { return escapeReservedWord(name); - } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) { + } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { return escape(name, specialCharReplacements, null, null); } return name; @@ -1547,7 +1547,7 @@ public class DefaultCodegen implements CodegenConfig { .generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue())) .build(); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList("double", "int", "long", @@ -1564,7 +1564,7 @@ public class DefaultCodegen implements CodegenConfig { "Float") ); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("array", "List"); typeMapping.put("set", "Set"); typeMapping.put("map", "Map"); @@ -1591,9 +1591,9 @@ public class DefaultCodegen implements CodegenConfig { typeMapping.put("URI", "URI"); typeMapping.put("AnyType", "oas_any_type_not_mapped"); - instantiationTypes = new HashMap(); + instantiationTypes = new HashMap<>(); - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); @@ -1748,7 +1748,7 @@ public class DefaultCodegen implements CodegenConfig { if (!param.getRequired()) { paramPart.append("]"); } - sb.append(paramPart.toString()); + sb.append(paramPart); } } } @@ -2382,14 +2382,14 @@ public class DefaultCodegen implements CodegenConfig { } } - Map schemaCodegenPropertyCache = new HashMap(); + Map schemaCodegenPropertyCache = new HashMap<>(); protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { final ComposedSchema composed = (ComposedSchema) schema; - Map properties = new LinkedHashMap(); - List required = new ArrayList(); - Map allProperties = new LinkedHashMap(); - List allRequired = new ArrayList(); + Map properties = new LinkedHashMap<>(); + List required = new ArrayList<>(); + Map allProperties = new LinkedHashMap<>(); + List allRequired = new ArrayList<>(); // if schema has properties outside of allOf/oneOf/anyOf also add them to m if (composed.getProperties() != null && !composed.getProperties().isEmpty()) { @@ -2407,7 +2407,7 @@ public class DefaultCodegen implements CodegenConfig { // TODO revise the logic below to set discriminator, xml attributes if (supportsInheritance || supportsMixins) { - m.allVars = new ArrayList(); + m.allVars = new ArrayList<>(); if (composed.getAllOf() != null) { int modelImplCnt = 0; // only one inline object allowed in a ComposedModel int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel @@ -2443,7 +2443,7 @@ public class DefaultCodegen implements CodegenConfig { if (!interfaces.isEmpty()) { // m.interfaces is for backward compatibility if (m.interfaces == null) - m.interfaces = new ArrayList(); + m.interfaces = new ArrayList<>(); for (Schema interfaceSchema : interfaces) { interfaceSchema = unaliasSchema(interfaceSchema, importMapping); @@ -2521,7 +2521,7 @@ public class DefaultCodegen implements CodegenConfig { m.parent = toModelName(parentName); if (supportsMultipleInheritance) { - m.allParents = new ArrayList(); + m.allParents = new ArrayList<>(); for (String pname : allParents) { String pModelName = toModelName(pname); m.allParents.add(pModelName); @@ -2673,7 +2673,7 @@ public class DefaultCodegen implements CodegenConfig { // TODO remove the anyType check here in the future ANyType models can have enums defined m.isEnum = true; // comment out below as allowableValues is not set in post processing model enum - m.allowableValues = new HashMap(); + m.allowableValues = new HashMap<>(); m.allowableValues.put("values", schema.getEnum()); } if (!ModelUtils.isArraySchema(schema)) { @@ -2742,7 +2742,7 @@ public class DefaultCodegen implements CodegenConfig { // set isDiscriminator on the discriminator property if (m.discriminator != null) { String discPropName = m.discriminator.getPropertyBaseName(); - List> listOLists = new ArrayList>(); + List> listOLists = new ArrayList<>(); listOLists.add(m.requiredVars); listOLists.add(m.vars); listOLists.add(m.allVars); @@ -3461,13 +3461,13 @@ public class DefaultCodegen implements CodegenConfig { //Inline enum case: if (p.getEnum() != null && !p.getEnum().isEmpty()) { List _enum = p.getEnum(); - property._enum = new ArrayList(); + property._enum = new ArrayList<>(); for (Object i : _enum) { property._enum.add(String.valueOf(i)); } property.isEnum = true; - Map allowableValues = new HashMap(); + Map allowableValues = new HashMap<>(); allowableValues.put("values", _enum); if (allowableValues.size() > 0) { property.allowableValues = allowableValues; @@ -3480,7 +3480,7 @@ public class DefaultCodegen implements CodegenConfig { if (referencedSchema.getEnum() != null && !referencedSchema.getEnum().isEmpty()) { List _enum = referencedSchema.getEnum(); - Map allowableValues = new HashMap(); + Map allowableValues = new HashMap<>(); allowableValues.put("values", _enum); if (allowableValues.size() > 0) { property.allowableValues = allowableValues; @@ -3783,7 +3783,7 @@ public class DefaultCodegen implements CodegenConfig { Map schemas, CodegenOperation op, ApiResponse methodResponse) { - handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); + handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); } /** @@ -3888,7 +3888,7 @@ public class DefaultCodegen implements CodegenConfig { Map schemas = ModelUtils.getSchemas(this.openAPI); CodegenOperation op = CodegenModelFactory.newInstance(CodegenModelType.OPERATION); - Set imports = new HashSet(); + Set imports = new HashSet<>(); if (operation.getExtensions() != null && !operation.getExtensions().isEmpty()) { op.vendorExtensions.putAll(operation.getExtensions()); @@ -3986,15 +3986,15 @@ public class DefaultCodegen implements CodegenConfig { } List parameters = operation.getParameters(); - List allParams = new ArrayList(); - List bodyParams = new ArrayList(); - List pathParams = new ArrayList(); - List queryParams = new ArrayList(); - List headerParams = new ArrayList(); - List cookieParams = new ArrayList(); - List formParams = new ArrayList(); - List requiredParams = new ArrayList(); - List optionalParams = new ArrayList(); + List allParams = new ArrayList<>(); + List bodyParams = new ArrayList<>(); + List pathParams = new ArrayList<>(); + List queryParams = new ArrayList<>(); + List headerParams = new ArrayList<>(); + List cookieParams = new ArrayList<>(); + List formParams = new ArrayList<>(); + List requiredParams = new ArrayList<>(); + List optionalParams = new ArrayList<>(); CodegenParameter bodyParam = null; RequestBody requestBody = operation.getRequestBody(); @@ -4039,7 +4039,7 @@ public class DefaultCodegen implements CodegenConfig { // add example if (schemas != null) { - op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType); + op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType); } } } @@ -4531,7 +4531,7 @@ public class DefaultCodegen implements CodegenConfig { return codegenParameter; } - parameterSchema = unaliasSchema(parameterSchema, Collections.emptyMap()); + parameterSchema = unaliasSchema(parameterSchema, Collections.emptyMap()); if (parameterSchema == null) { LOGGER.warn("warning! Schema not found for parameter \" {} \", using String", parameter.getName()); parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition."); @@ -4755,7 +4755,7 @@ public class DefaultCodegen implements CodegenConfig { return Collections.emptyList(); } - List codegenSecurities = new ArrayList(securitySchemeMap.size()); + List codegenSecurities = new ArrayList<>(securitySchemeMap.size()); for (String key : securitySchemeMap.keySet()) { final SecurityScheme securityScheme = securitySchemeMap.get(key); if (SecurityScheme.Type.APIKEY.equals(securityScheme.getType())) { @@ -4855,7 +4855,7 @@ public class DefaultCodegen implements CodegenConfig { } protected void setReservedWordsLowerCase(List words) { - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); for (String word : words) { reservedWords.add(word.toLowerCase(Locale.ROOT)); } @@ -4918,9 +4918,9 @@ public class DefaultCodegen implements CodegenConfig { return null; } - final List> output = new ArrayList>(examples.size()); + final List> output = new ArrayList<>(examples.size()); for (Map.Entry entry : examples.entrySet()) { - final Map kv = new HashMap(); + final Map kv = new HashMap<>(); kv.put("contentType", entry.getKey()); kv.put("example", entry.getValue()); output.add(kv); @@ -4976,7 +4976,7 @@ public class DefaultCodegen implements CodegenConfig { co, Map> operations) { List opList = operations.get(tag); if (opList == null) { - opList = new ArrayList(); + opList = new ArrayList<>(); operations.put(tag, opList); } // check for operationId uniqueness @@ -5084,8 +5084,8 @@ public class DefaultCodegen implements CodegenConfig { m.hasVars = true; m.hasEnums = false; // TODO need to fix as its false in both cases - Set mandatory = required == null ? Collections.emptySet() - : new TreeSet(required); + Set mandatory = required == null ? Collections.emptySet() + : new TreeSet<>(required); // update "vars" without parent's properties (all, required) addVars(m, m.vars, properties, mandatory); @@ -5097,8 +5097,8 @@ public class DefaultCodegen implements CodegenConfig { } if (allProperties != null) { - Set allMandatory = allRequired == null ? Collections.emptySet() - : new TreeSet(allRequired); + Set allMandatory = allRequired == null ? Collections.emptySet() + : new TreeSet<>(allRequired); // update "vars" with parent's properties (all, required) addVars(m, m.allVars, allProperties, allMandatory); m.allMandatory = allMandatory; @@ -5108,14 +5108,14 @@ public class DefaultCodegen implements CodegenConfig { } // loop through list to update property name with toVarName - Set renamedMandatory = new ConcurrentSkipListSet(); + Set renamedMandatory = new ConcurrentSkipListSet<>(); Iterator mandatoryIterator = m.mandatory.iterator(); while (mandatoryIterator.hasNext()) { renamedMandatory.add(toVarName(mandatoryIterator.next())); } m.mandatory = renamedMandatory; - Set renamedAllMandatory = new ConcurrentSkipListSet(); + Set renamedAllMandatory = new ConcurrentSkipListSet<>(); Iterator allMandatoryIterator = m.allMandatory.iterator(); while (allMandatoryIterator.hasNext()) { renamedAllMandatory.add(toVarName(allMandatoryIterator.next())); @@ -5568,7 +5568,7 @@ public class DefaultCodegen implements CodegenConfig { * @return sanitized string */ public String sanitizeName(String name, String removeCharRegEx) { - return sanitizeName(name, removeCharRegEx, new ArrayList()); + return sanitizeName(name, removeCharRegEx, new ArrayList<>()); } /** @@ -5827,7 +5827,7 @@ public class DefaultCodegen implements CodegenConfig { enumName = String.valueOf(value); } else { enumName = value.toString().substring(truncateIdx); - if ("".equals(enumName)) { + if (enumName.isEmpty()) { enumName = value.toString(); } } @@ -6057,7 +6057,7 @@ public class DefaultCodegen implements CodegenConfig { return null; } - Set produces = new ConcurrentSkipListSet(); + Set produces = new ConcurrentSkipListSet<>(); for (ApiResponse r : operation.getResponses().values()) { ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, r); @@ -6108,7 +6108,7 @@ public class DefaultCodegen implements CodegenConfig { LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); Schema schema = ModelUtils.getSchemaFromRequestBody(body); schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - List allRequired = new ArrayList(); + List allRequired = new ArrayList<>(); Map properties = new LinkedHashMap<>(); // this traverses a composed schema and extracts all properties in each schema into properties // TODO in the future have this return one codegenParameter of type object or composed which includes all definition @@ -6289,7 +6289,7 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.datatypeWithEnum = codegenProperty.datatypeWithEnum; codegenParameter.enumName = codegenProperty.enumName; } - + // import if (codegenProperty.complexType != null) { imports.add(codegenProperty.complexType); @@ -6953,7 +6953,7 @@ public class DefaultCodegen implements CodegenConfig { cm.name = type; cm.classname = type; cm.vendorExtensions.put("x-is-one-of-interface", true); - cm.interfaceModels = new ArrayList(); + cm.interfaceModels = new ArrayList<>(); addOneOfInterfaces.add(cm); } @@ -7171,7 +7171,7 @@ public class DefaultCodegen implements CodegenConfig { List xOf = new ArrayList<>(); int i = 0; for (Schema xOfSchema: xOfCollection) { - CodegenProperty cp = fromProperty(collectionName + "_" + String.valueOf(i), xOfSchema); + CodegenProperty cp = fromProperty(collectionName + "_" + i, xOfSchema); xOf.add(cp); i += 1; } 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 62e678621d4..815342dfea7 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 @@ -268,7 +268,11 @@ public class DefaultGenerator implements Generator { URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility basePathWithoutHost = contextPath; - basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides()))); + if (URLPathUtils.isRelativeUrl(openAPI.getServers())) { + basePath = removeTrailingSlash(basePathWithoutHost); + } else { + basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides()))); + } } private void configureOpenAPIInfo() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java index 2d8e65ba993..f8b7371c10c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java @@ -129,6 +129,6 @@ public class SpecValidationException extends RuntimeException { }); return super.getMessage() + " | " + - "Error count: " + errorCount + ", Warning count: " + warningCount + sb.toString(); + "Error count: " + errorCount + ", Warning count: " + warningCount + sb; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplateManager.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplateManager.java index 072bb4037ef..691096b39f6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplateManager.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplateManager.java @@ -103,7 +103,7 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor { * @param name The location of the template * @return The raw template contents */ - @SuppressWarnings({"java:S112"}) + @SuppressWarnings("java:S112") // ignored rule java:S112 as RuntimeException is used to match previous exception type public String readTemplate(String name) { if (name == null || name.contains("..")) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java index eaacdb26a8f..ea471a5a5da 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java @@ -26,7 +26,7 @@ public class TemplatingEngineLoader { throw new IllegalStateException("Utility class"); } - @SuppressWarnings({"java:S112"}) // ignore java:S112 as generic RuntimeException is acceptable here + @SuppressWarnings("java:S112") // ignore java:S112 as generic RuntimeException is acceptable here public static TemplatingEngineAdapter byIdentifier(String id) { ServiceLoader loader = ServiceLoader.load(TemplatingEngineAdapter.class, TemplatingEngineLoader.class.getClassLoader()); @@ -42,7 +42,7 @@ public class TemplatingEngineLoader { // Attempt to load skipping SPI return (TemplatingEngineAdapter) Class.forName(id).getDeclaredConstructor().newInstance(); } catch (Exception e) { - throw new RuntimeException(String.format(Locale.ROOT, "Couldn't load template engine adapter %s. Available options: %n%s", id, sb.toString()), e); + throw new RuntimeException(String.format(Locale.ROOT, "Couldn't load template engine adapter %s. Available options: %n%s", id, sb), e); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 01302ab1dcd..b5bd0b23c33 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -534,9 +534,17 @@ public class CodegenConfigurator { if (validationMessages.size() > 0) { Set warnings = new HashSet<>(); if (specification != null) { - List unusedModels = ModelUtils.getUnusedSchemas(specification); - if (unusedModels != null) { - unusedModels.forEach(name -> warnings.add("Unused model: " + name)); + + // Wrap the getUnusedSchemas() in try catch block so it catches the NPE + // when the input spec file is not correct + try{ + List unusedModels = ModelUtils.getUnusedSchemas(specification); + if (unusedModels != null) { + unusedModels.forEach(name -> warnings.add("Unused model: " + name)); + } + } catch (Exception e){ + System.err.println("[error] There is an error with OpenAPI specification parsed from the input spec file: " + inputSpec); + System.err.println("[error] Please make sure the spec file has correct format and all required fields are populated with valid value."); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java index fc1f7aa77c2..8b7f64b7256 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java @@ -165,7 +165,7 @@ public class ExampleGenerator { } } else if (modelName != null && mediaType.startsWith(MIME_TYPE_XML)) { final Schema schema = this.examples.get(modelName); - String example = new XmlExampleGenerator(this.examples).toXml(schema, 0, Collections.emptySet()); + String example = new XmlExampleGenerator(this.examples).toXml(schema, 0, Collections.emptySet()); if (example != null) { kv.put(EXAMPLE, example); output.add(kv); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java index 91d5a0120a4..bee395a1d6a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java @@ -44,7 +44,7 @@ public class XmlExampleGenerator { } public String toXml(Schema schema) { - return toXml(null, schema, 0, Collections.emptySet()); + return toXml(null, schema, 0, Collections.emptySet()); } protected String toXml(Schema schema, int indent, Collection path) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java index 91b4499b1af..9ac1d3825a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java @@ -41,7 +41,7 @@ public class RootedFileRule extends Rule { } private String getExtensionPart(final String input, int stopIndex) { - return input.substring(stopIndex > 0 ? stopIndex+1: input.length(), input.length()); + return input.substring(stopIndex > 0 ? stopIndex+1: input.length()); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 7ef64adcd71..9670576e7db 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -50,7 +50,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg protected List> orderedModels; protected final Map> modelDepends; protected final Map nullableTypeMapping; - protected final HashMap operationsScopes; + protected final Map operationsScopes; protected int scopeIndex = 0; public AbstractAdaCodegen() { @@ -155,7 +155,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg "xor") ); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("date", "Swagger.Date"); typeMapping.put("DateTime", "Swagger.Datetime"); typeMapping.put("string", "Swagger.UString"); @@ -172,7 +172,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg typeMapping.put("binary", "Swagger.Binary"); // Mapping to convert an Ada required type to an optional type (nullable). - nullableTypeMapping = new HashMap(); + nullableTypeMapping = new HashMap<>(); nullableTypeMapping.put("Swagger.Date", "Swagger.Nullable_Date"); nullableTypeMapping.put("Swagger.Datetime", "Swagger.Nullable_Date"); nullableTypeMapping.put("Swagger.UString", "Swagger.Nullable_UString"); @@ -181,10 +181,10 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg nullableTypeMapping.put("Boolean", "Swagger.Nullable_Boolean"); nullableTypeMapping.put("Swagger.Object", "Swagger.Object"); - modelDepends = new HashMap>(); - orderedModels = new ArrayList>(); - operationsScopes = new HashMap(); - super.importMapping = new HashMap(); + modelDepends = new HashMap<>(); + orderedModels = new ArrayList<>(); + operationsScopes = new HashMap<>(); + super.importMapping = new HashMap<>(); // CLI options addOption(CodegenConstants.PROJECT_NAME, "GNAT project name", @@ -193,7 +193,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg modelNameSuffix = "Type"; embeddedTemplateDir = templateDir = "Ada"; - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("integer", "boolean", "number", "long", "float", "double", "object", "string", "date", "DateTime", "binary")); } @@ -651,7 +651,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg Object v = model.get("model"); if (v instanceof CodegenModel) { CodegenModel m = (CodegenModel) v; - List d = new ArrayList(); + List d = new ArrayList<>(); for (CodegenProperty p : m.vars) { boolean isModel = false; CodegenProperty item = p; @@ -687,8 +687,8 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg // if I find a model that has no dependencies, or all of its dependencies are in revisedOrderedModels, consider it the independentModel // put the independentModel at the end of revisedOrderedModels, and remove it from orderedModels // - List> revisedOrderedModels = new ArrayList>(); - List collectedModelNames = new ArrayList(); + List> revisedOrderedModels = new ArrayList<>(); + List collectedModelNames = new ArrayList<>(); int sizeOrderedModels = orderedModels.size(); for (int i = 0; i < sizeOrderedModels; i++) { Map independentModel = null; @@ -760,7 +760,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg * @return the authMethods to be used by the operation with its required scopes. */ private List postProcessAuthMethod(List authMethods, Map> scopes) { - List result = (scopes == null) ? null : new ArrayList(); + List result = (scopes == null) ? null : new ArrayList<>(); if (authMethods != null) { for (CodegenSecurity authMethod : authMethods) { if (authMethod.scopes != null) { @@ -803,7 +803,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg opSecurity.isKeyInQuery = authMethod.isKeyInQuery; opSecurity.flow = authMethod.flow; opSecurity.tokenUrl = authMethod.tokenUrl; - List> opAuthScopes = new ArrayList>(); + List> opAuthScopes = new ArrayList<>(); for (String opScopeName : opScopes) { for (Map scope : authMethod.scopes) { String name = (String) scope.get("scope"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 086d63af29b..a42ee2dadab 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -81,9 +81,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co protected boolean supportNullable = Boolean.FALSE; // nullable type - protected Set nullableType = new HashSet(); + protected Set nullableType = new HashSet<>(); - protected Set valueTypes = new HashSet(); + protected Set valueTypes = new HashSet<>(); private final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class); @@ -104,14 +104,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co outputFolder = "generated-code" + File.separator + this.getName(); embeddedTemplateDir = templateDir = this.getName(); - collectionTypes = new HashSet( + collectionTypes = new HashSet<>( Arrays.asList( "IList", "List", "ICollection", "Collection", "IEnumerable") ); - mapTypes = new HashSet( + mapTypes = new HashSet<>( Arrays.asList("IDictionary") ); @@ -141,7 +141,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co ); // TODO: Either include fully qualified names here or handle in DefaultCodegen via lastIndexOf(".") search - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "String", "string", @@ -184,7 +184,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // Nullable types here assume C# 2 support is not part of base - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("string", "string"); typeMapping.put("binary", "byte[]"); typeMapping.put("ByteArray", "byte[]"); @@ -207,11 +207,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co typeMapping.put("AnyType", "Object"); // nullable type - nullableType = new HashSet( + nullableType = new HashSet<>( Arrays.asList("decimal", "bool", "int", "float", "long", "double", "DateTime", "DateTimeOffset", "Guid") ); // value Types - valueTypes = new HashSet( + valueTypes = new HashSet<>( Arrays.asList("decimal", "bool", "int", "float", "long", "double") ); } @@ -463,9 +463,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co * * @param models processed models to be further processed for enum references */ - @SuppressWarnings({"unchecked"}) + @SuppressWarnings("unchecked") private void postProcessEnumRefs(final Map models) { - Map enumRefs = new HashMap(); + Map enumRefs = new HashMap<>(); for (Map.Entry entry : models.entrySet()) { CodegenModel model = ModelUtils.getModelByName(entry.getKey(), models); if (model.isEnum) { @@ -1325,7 +1325,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // only process files with .cs extension if ("cs".equals(FilenameUtils.getExtension(file.toString()))) { - String command = csharpPostProcessFile + " " + file.toString(); + String command = csharpPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index a6950c776fe..982980afbc8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -323,7 +323,7 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg } // only process files with cpp extension if ("cpp".equals(FilenameUtils.getExtension(file.toString())) || "h".equals(FilenameUtils.getExtension(file.toString()))) { - String command = cppPostProcessFile + " " + file.toString(); + String command = cppPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index f2d2bc289a6..86af0181b3d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -340,7 +340,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { // replace all characters that have a mapping but ignore underscores // append an underscore to each replacement so that it can be camelized - if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) { + if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { name = escape(name, specialCharReplacements, Collections.singletonList("_"), "_"); } // remove the rest @@ -752,7 +752,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { // process all files with dart extension if ("dart".equals(FilenameUtils.getExtension(file.toString()))) { // currently supported is "dartfmt -w" and "dart format" - String command = dartPostProcessFile + " " + file.toString(); + String command = dartPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index e11579a2713..85cc06c3c6d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -53,9 +53,9 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co "redefine", "rename", "require", "rescue", "Result", "retry", "select", "separate", "then", "True", "TUPLE", "undefine", "until", "variant", "Void", "when", "xor")); - defaultIncludes = new HashSet(Arrays.asList("map", "array")); + defaultIncludes = new HashSet<>(Arrays.asList("map", "array")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("BOOLEAN", "INTEGER_8", "INTEGER_16", "INTEGER_32", "INTEGER_64", "NATURAL_8", "NATURAL_16", "NATURAL_32", "NATURAL_64", "REAL_32", "REAL_64")); @@ -559,7 +559,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co } public Map createMapping(String key, String value) { - Map customImport = new HashMap(); + Map customImport = new HashMap<>(); customImport.put(key, value); return customImport; @@ -592,7 +592,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co public String toEiffelFeatureStyle(String operationId) { if (operationId.startsWith("get_")) { - return operationId.substring(4, operationId.length()); + return operationId.substring(4); } else { return operationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index 527481ecbdb..e2e9d96dc9f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -73,7 +73,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co // true if nullable types will be supported (as option) protected boolean supportNullable = Boolean.TRUE; - protected Set nullableType = new HashSet(); + protected Set nullableType = new HashSet<>(); private final Logger LOGGER = LoggerFactory.getLogger(AbstractFSharpCodegen.class); @@ -89,9 +89,9 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co outputFolder = this.getName(); embeddedTemplateDir = templateDir = this.getName(); - collectionTypes = new HashSet(Arrays.asList("list", "seq")); + collectionTypes = new HashSet<>(Arrays.asList("list", "seq")); - mapTypes = new HashSet( + mapTypes = new HashSet<>( Arrays.asList("IDictionary") ); @@ -114,7 +114,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co ); // TODO - these are based on C# generator, do we need to add any more? - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "String", "string", @@ -156,7 +156,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co instantiationTypes.put("map", "IDictionary"); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("string", "string"); typeMapping.put("binary", "byte[]"); typeMapping.put("ByteArray", "byte[]"); @@ -177,7 +177,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co typeMapping.put("URI", "string"); // nullable type - nullableType = new HashSet( + nullableType = new HashSet<>( Arrays.asList("decimal", "bool", "int", "float", "long", "double", "string", "Guid", "apiKey") ); } @@ -349,12 +349,12 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co * Output of CodeGen models must therefore be in dependency order (rather than alphabetical order, which seems to be the default). * This could probably be made more efficient if absolutely needed. */ - @SuppressWarnings({"unchecked"}) + @SuppressWarnings("unchecked") public Map postProcessDependencyOrders(final Map objs) { - Map> dependencies = new HashMap>(); + Map> dependencies = new HashMap<>(); - List classNames = new ArrayList(); + List classNames = new ArrayList<>(); for (String k : objs.keySet()) { CodegenModel model = ModelUtils.getModelByName(k, objs); @@ -381,7 +381,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co } } - Map sorted = new LinkedHashMap(); + Map sorted = new LinkedHashMap<>(); for (int i = sortedKeys.length - 1; i >= 0; i--) { Object k = sortedKeys[i]; sorted.put(k.toString(), objs.get(k)); @@ -400,9 +400,9 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co * * @param models processed models to be further processed for enum references */ - @SuppressWarnings({"unchecked"}) + @SuppressWarnings("unchecked") private void postProcessEnumRefs(final Map models) { - Map enumRefs = new HashMap(); + Map enumRefs = new HashMap<>(); for (Map.Entry entry : models.entrySet()) { CodegenModel model = ModelUtils.getModelByName(entry.getKey(), models); if (model.isEnum) { @@ -455,10 +455,9 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co // Since we iterate enumVars for modelInnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties, // we can take advantage of Mustache's contextual lookup to add the same "properties" to the model's enumVars scope rather than CodegenProperty's scope. List> enumVars = (ArrayList>) model.allowableValues.get("enumVars"); - List> newEnumVars = new ArrayList>(); + List> newEnumVars = new ArrayList<>(); for (Map enumVar : enumVars) { - Map mixedVars = new HashMap(); - mixedVars.putAll(enumVar); + Map mixedVars = new HashMap<>(enumVar); mixedVars.put("isString", isString); mixedVars.put("isLong", isLong); @@ -473,7 +472,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co } } } else { - LOGGER.warn("Expected to retrieve model %s by name, but no model was found. Check your -Dmodels inclusions.", openAPIName); + LOGGER.warn("Expected to retrieve model {} by name, but no model was found. Check your -Dmodels inclusions.", openAPIName); } } } @@ -1115,7 +1114,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co // only process files with .fs extension if ("fs".equals(FilenameUtils.getExtension(file.toString()))) { - String command = fsharpPostProcessFile + " " + file.toString(); + String command = fsharpPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 3c3f002b187..803fc6ace34 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -56,7 +56,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege supportsInheritance = true; hideGenerationTimestamp = Boolean.FALSE; - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") @@ -77,7 +77,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege // Added "error" as it's used so frequently that it may as well be a keyword ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "string", "bool", @@ -133,14 +133,14 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege typeMapping.put("object", "map[string]interface{}"); typeMapping.put("AnyType", "interface{}"); - numberTypes = new HashSet( + numberTypes = new HashSet<>( Arrays.asList( "uint", "uint8", "uint16", "uint32", "uint64", "int", "int8", "int16", "int32", "int64", "float32", "float64") ); - importMapping = new HashMap(); + importMapping = new HashMap<>(); cliOptions.clear(); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Go package name (convention: lowercase).") @@ -252,7 +252,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege String[] parts = name.split("_"); String suffix = parts[parts.length - 1]; - Set reservedSuffixes = new HashSet(Arrays.asList( + Set reservedSuffixes = new HashSet<>(Arrays.asList( // Test "test", // $GOOS @@ -699,7 +699,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } public Map createMapping(String key, String value) { - Map customImport = new HashMap(); + Map customImport = new HashMap<>(); customImport.put(key, value); return customImport; @@ -813,7 +813,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } // only process the following type (or we can simply rely on the file extension to check if it's a Go file) - Set supportedFileType = new HashSet( + Set supportedFileType = new HashSet<>( Arrays.asList( "supporting-mustache", "model-test", @@ -828,7 +828,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege if ("go".equals(FilenameUtils.getExtension(file.toString()))) { // e.g. "gofmt -w yourcode.go" // e.g. "go fmt path/to/your/package" - String command = goPostProcessFile + " " + file.toString(); + String command = goPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java index 0742a6b4459..bc9914a2b00 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java @@ -55,13 +55,13 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "null", "ID", @@ -344,7 +344,7 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C } public Map createMapping(String key, String value) { - Map customImport = new HashMap(); + Map customImport = new HashMap<>(); customImport.put(key, value); return customImport; 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 77cd594f7fb..35c07bef619 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 @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import com.google.common.base.Strings; +import com.google.common.collect.Sets; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -164,9 +165,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code "native", "super", "while", "null") ); - languageSpecificPrimitives = new HashSet( - Arrays.asList( - "String", + languageSpecificPrimitives = Sets.newHashSet("String", "boolean", "Boolean", "Double", @@ -174,7 +173,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code "Long", "Float", "Object", - "byte[]") + "byte[]" ); instantiationTypes.put("array", "ArrayList"); instantiationTypes.put("set", "LinkedHashSet"); @@ -508,6 +507,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // optional jackson mappings for BigDecimal support importMapping.put("ToStringSerializer", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer"); importMapping.put("JsonSerialize", "com.fasterxml.jackson.databind.annotation.JsonSerialize"); + importMapping.put("JsonDeserialize", "com.fasterxml.jackson.databind.annotation.JsonDeserialize"); // imports for pojos importMapping.put("ApiModelProperty", "io.swagger.annotations.ApiModelProperty"); @@ -713,7 +713,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } // If name contains special chars -> replace them. - if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character))))) { + if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character))))) { List allowedCharacters = new ArrayList<>(); allowedCharacters.add("_"); allowedCharacters.add("$"); @@ -996,7 +996,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code */ @Override public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - Boolean isModel = (codegenParameter.isModel || (codegenParameter.isContainer && codegenParameter.getItems().isModel)); + boolean isModel = (codegenParameter.isModel || (codegenParameter.isContainer && codegenParameter.getItems().isModel)); Content content = requestBody.getContent(); @@ -1228,6 +1228,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code model.imports.add("ArrayList"); } else if ("set".equals(property.containerType)) { model.imports.add("LinkedHashSet"); + model.imports.add("JsonDeserialize"); + property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); } else if ("map".equals(property.containerType)) { model.imports.add("HashMap"); } @@ -1245,6 +1247,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code model.getVendorExtensions().put("x-jackson-optional-nullable-helpers", true); } } + + if (property.isReadOnly) { + model.getVendorExtensions().put("x-has-readonly-properties", true); + } } @Override @@ -1260,7 +1266,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // if the import package happens to be found in the importMapping (key) // add the corresponding import package to the list if (importMapping.containsKey(_import)) { - Map newImportMap = new HashMap(); + Map newImportMap = new HashMap<>(); newImportMap.put("import", importMapping.get(_import)); listIterator.add(newImportMap); } @@ -1285,7 +1291,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { - Collection operationImports = new ConcurrentSkipListSet(); + Collection operationImports = new ConcurrentSkipListSet<>(); for (CodegenParameter p : op.allParams) { if (importMapping.containsKey(p.dataType)) { operationImports.add(importMapping.get(p.dataType)); @@ -1314,7 +1320,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) { String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json"; List consumes = new ArrayList<>(getConsumesInfo(openAPI, operation)); - String contentType = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0); + String contentType = consumes.isEmpty() ? defaultContentType : consumes.get(0); operation.addExtension("x-contentType", contentType); } String accepts = getAccept(openAPI, operation); @@ -1865,7 +1871,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // only process files with java extension if ("java".equals(FilenameUtils.getExtension(file.toString()))) { - String command = javaPostProcessFile + " " + file.toString(); + String command = javaPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java index d930e0b33e6..0cb56e084e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -66,7 +66,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - updateOption(this.DATE_LIBRARY, this.getDateLibrary()); + updateOption(DATE_LIBRARY, this.getDateLibrary()); additionalProperties.put("title", title); // java inflector uses the jackson lib diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index e6f68a871a8..e0fb899e2f3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -78,7 +78,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co supportsInheritance = true; setSortModelPropertiesByRequiredFlag(true); - languageSpecificPrimitives = new HashSet(Arrays.asList( + languageSpecificPrimitives = new HashSet<>(Arrays.asList( "kotlin.Byte", "kotlin.ByteArray", "kotlin.Short", @@ -97,7 +97,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html - reservedWords = new HashSet(Arrays.asList( + reservedWords = new HashSet<>(Arrays.asList( "abstract", "actual", "annotation", @@ -171,7 +171,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co "while" )); - defaultIncludes = new HashSet(Arrays.asList( + defaultIncludes = new HashSet<>(Arrays.asList( "kotlin.Byte", "kotlin.ByteArray", "kotlin.Short", @@ -187,7 +187,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co "kotlin.collections.Map" )); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("string", "kotlin.String"); typeMapping.put("boolean", "kotlin.Boolean"); typeMapping.put("integer", "kotlin.Int"); @@ -214,7 +214,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co instantiationTypes.put("list", "kotlin.collections.ArrayList"); instantiationTypes.put("map", "kotlin.collections.HashMap"); - importMapping = new HashMap(); + importMapping = new HashMap<>(); importMapping.put("BigDecimal", "java.math.BigDecimal"); importMapping.put("UUID", "java.util.UUID"); importMapping.put("URI", "java.net.URI"); @@ -896,7 +896,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } // If name contains special chars -> replace them. - if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character))))) { + if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character))))) { List allowedCharacters = new ArrayList<>(); allowedCharacters.add("_"); allowedCharacters.add("$"); @@ -941,7 +941,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // only process files with kt extension if ("kt".equals(FilenameUtils.getExtension(file.toString()))) { - String command = kotlinPostProcessFile + " " + file.toString(); + String command = kotlinPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index db208bb9829..db9c3e42029 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -79,7 +79,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg ); // ref: http://php.net/manual/en/language.types.intro.php - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "boolean", @@ -107,7 +107,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg additionalProperties.put("primitives", primitives); // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("integer", "int"); typeMapping.put("long", "int"); typeMapping.put("number", "float"); @@ -769,7 +769,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg } // only process files with php extension if ("php".equals(FilenameUtils.getExtension(file.toString()))) { - String command = phpPostProcessFile + " " + file.toString(); + String command = phpPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index 00caff0f8cc..f07cef7e4de 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -270,7 +270,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // only process files with py extension if ("py".equals(FilenameUtils.getExtension(file.toString()))) { - String command = pythonPostProcessFile + " " + file.toString(); + String command = pythonPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index e0912beb2cc..400e417a85b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -666,11 +666,11 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho operation.isMultipart = Boolean.TRUE; } } - operation.vendorExtensions.put("x-prefered-consume", consume); + operation.vendorExtensions.put("x-preferred-consume", consume); } else if (operation.consumes.size() > 1) { Map consume = operation.consumes.get(0); skipTests.put("reason", "Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760"); - operation.vendorExtensions.put("x-prefered-consume", consume); + operation.vendorExtensions.put("x-preferred-consume", consume); if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) { operation.isMultipart = Boolean.TRUE; } @@ -680,14 +680,14 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho if (operation.bodyParam != null) { Map consume = new HashMap<>(); consume.put(MEDIA_TYPE, "application/json"); - operation.vendorExtensions.put("x-prefered-consume", consume); + operation.vendorExtensions.put("x-preferred-consume", consume); skipTests.put("reason", "*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760"); } } // Choose to consume 'application/json' if available, else choose the last one. if (operation.produces != null) { for (Map produce : operation.produces) { - operation.vendorExtensions.put("x-prefered-produce", produce); + operation.vendorExtensions.put("x-preferred-produce", produce); if (produce.get(MEDIA_TYPE).equals("application/json")) { break; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index 263512fb0cd..67fe9bc6d93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -238,7 +238,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code } // only process files with rb extension if ("rb".equals(FilenameUtils.getExtension(file.toString()))) { - String command = rubyPostProcessFile + " " + file.toString(); + String command = rubyPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); @@ -250,7 +250,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code while ((line = br.readLine()) != null) { sb.append(line); } - LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString()); + LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb); } } else { LOGGER.info("Successfully executed: `{}`", command); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index 65ec72caca6..c3132a06f42 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -46,7 +46,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { protected String dateLibrary = DateLibraries.java8.name(); protected enum DateLibraries { - java8("Java 8 native JSR310 (prefered for JDK 1.8+)"), + java8("Java 8 native JSR310 (preferred for JDK 1.8+)"), joda( "Joda (for legacy app)"), legacy( "Backport to http-client (deprecated)"); @@ -529,7 +529,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { // only process files with scala extension if ("scala".equals(FilenameUtils.getExtension(file.toString()))) { - String command = scalaPostProcessFile + " " + file.toString(); + String command = scalaPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 1059732e84e..647ecda7a04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -181,7 +181,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp " Required to generate a full package")); this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package. If not provided, using the version from the OpenAPI specification file.").defaultValue(this.getNpmVersion())); this.cliOptions.add(CliOption.newBoolean(SNAPSHOT, - "When setting this property to true, the version will be suffixed with -SNAPSHOT." + this.SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), + "When setting this property to true, the version will be suffixed with -SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), false)); this.cliOptions.add(new CliOption(NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_DESC).defaultValue(String.valueOf(this.getNullSafeAdditionalProps()))); } @@ -896,7 +896,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } // only process files with ts extension if ("ts".equals(FilenameUtils.getExtension(file.toString()))) { - String command = tsPostProcessFile + " " + file.toString(); + String command = tsPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index d1c6fb6a3e8..b0bbe14c92e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -117,7 +117,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi "native", "super", "while", "null") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "String", "boolean", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java index e5ad82eb1b0..4c56b3c0eef 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java @@ -49,7 +49,7 @@ public class ApexClientCodegen extends AbstractApexCodegen { private String namedCredential; private String srcPath = "force-app/main/default/"; private String sfdxConfigPath = "config/"; - private HashMap primitiveDefaults = new HashMap(); + private HashMap primitiveDefaults = new HashMap<>(); public ApexClientCodegen() { super(); @@ -113,7 +113,7 @@ public class ApexClientCodegen extends AbstractApexCodegen { "virtual", "void", "webservice", "when", "where", "while" )); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("Blob", "Boolean", "Date", "Datetime", "Decimal", "Double", "ID", "Integer", "Long", "Object", "String", "Time" )); @@ -233,7 +233,7 @@ public class ApexClientCodegen extends AbstractApexCodegen { out = String.valueOf(p.getDefault()); } else if (ModelUtils.isLongSchema(p)) { Long def = (Long) p.getDefault(); - out = def == null ? out : def.toString() + "L"; + out = def == null ? out : def + "L"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = getAdditionalProperties(p); String s = inner == null ? "Object" : getTypeDeclaration(inner); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index fa66f2a33a2..af1e53ab7ab 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -89,10 +89,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code String includeStatement = "include::{" + attributePathReference + "}" + escapeCurlyBrackets(relativeFileName) + "[opts=optional]"; if (Files.isRegularFile(filePathToInclude)) { - LOGGER.debug("including {}. file into markup from: {}", ++includeCount, filePathToInclude.toString()); + LOGGER.debug("including {}. file into markup from: {}", ++includeCount, filePathToInclude); out.write("\n" + includeStatement + "\n"); } else { - LOGGER.debug("{}. file not found, skip include for: {}", ++notFoundCount, filePathToInclude.toString()); + LOGGER.debug("{}. file not found, skip include for: {}", ++notFoundCount, filePathToInclude); out.write("\n// markup not found, no " + includeStatement + "\n"); } } @@ -140,10 +140,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code final Path filePathToLinkTo = Paths.get(basePath, relativeFileName).toAbsolutePath(); if (Files.isRegularFile(filePathToLinkTo)) { - LOGGER.debug("linking {}. file into markup from: {}", ++linkedCount, filePathToLinkTo.toString()); + LOGGER.debug("linking {}. file into markup from: {}", ++linkedCount, filePathToLinkTo); out.write("\n" + linkName + " link:" + relativeFileName + "[]\n"); } else { - LOGGER.debug("{}. file not found, skip link for: {}", ++notFoundLinkCount, filePathToLinkTo.toString()); + LOGGER.debug("{}. file not found, skip link for: {}", ++notFoundLinkCount, filePathToLinkTo); out.write("\n// file not found, no " + linkName + " link :" + relativeFileName + "[]\n"); } } @@ -217,7 +217,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code outputFolder = "generated-code" + File.separator + "asciidoc"; embeddedTemplateDir = templateDir = "asciidoc-documentation"; - defaultIncludes = new HashSet(); + defaultIncludes = new HashSet<>(); cliOptions.add(new CliOption("appName", "short name of the application")); cliOptions.add(new CliOption("appDescription", "description of the application")); @@ -264,10 +264,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); supportingFiles.add(new SupportingFile("index.mustache", "", "index.adoc")); - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); - languageSpecificPrimitives = new HashSet(); - importMapping = new HashMap(); + languageSpecificPrimitives = new HashSet<>(); + importMapping = new HashMap<>(); } @@ -325,7 +325,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code public void processOpts() { super.processOpts(); - String specDir = this.additionalProperties.get(SPEC_DIR) + ""; + String specDir = String.valueOf(this.additionalProperties.get(SPEC_DIR)); if (!Files.isDirectory(Paths.get(specDir))) { LOGGER.warn("base part for include markup lambda not found: {} as {}", specDir, Paths.get(specDir).toAbsolutePath()); } @@ -333,7 +333,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code this.includeSpecMarkupLambda = new IncludeMarkupLambda(SPEC_DIR,specDir); additionalProperties.put("specinclude", this.includeSpecMarkupLambda); - String snippetDir = this.additionalProperties.get(SNIPPET_DIR) + ""; + String snippetDir = String.valueOf(this.additionalProperties.get(SNIPPET_DIR)); if (!Files.isDirectory(Paths.get(snippetDir))) { LOGGER.warn("base part for include markup lambda not found: {} as {}", snippetDir, Paths.get(snippetDir).toAbsolutePath()); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index f27d9c452a7..43b1cbab49e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -444,7 +444,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { } // Converts, for example, PUT to HttpPut for controller attributes - operation.httpMethod = "Http" + operation.httpMethod.substring(0, 1) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT); + operation.httpMethod = "Http" + operation.httpMethod.charAt(0) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT); } @Override @@ -472,7 +472,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { continue; } - if(consumesString.toString().equals("")) { + if(consumesString.toString().isEmpty()) { consumesString = new StringBuilder("\"" + consume.get("mediaType") + "\""); } else { @@ -500,7 +500,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { } } - if(!consumesString.toString().equals("")) { + if(!consumesString.toString().isEmpty()) { operation.vendorExtensions.put("x-aspnetcore-consumes", consumesString.toString()); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 85e68a20354..5ca5fbb156b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -209,7 +209,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { /** * Bash reserved words. */ - reservedWords = new HashSet( + reservedWords = new HashSet<>( Arrays.asList( "case", "do", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index 58803d150a1..d48d0f77489 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -874,7 +874,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf } // only process the following type (or we can simply rely on the file extension to check if it's a .c or .h file) - Set supportedFileType = new HashSet( + Set supportedFileType = new HashSet<>( Arrays.asList( "supporting-mustache", "model-test", @@ -888,7 +888,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf // only process files with .c or .h extension if ("c".equals(FilenameUtils.getExtension(file.toString())) || "h".equals(FilenameUtils.getExtension(file.toString()))) { - String command = cPostProcessFile + " " + file.toString(); + String command = cPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 3b06619b845..6700545a65f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -35,7 +35,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; public class CSharpClientCodegen extends AbstractCSharpCodegen { - @SuppressWarnings({"hiding"}) + @SuppressWarnings("hiding") private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); private static final String NUNIT = "nunit"; private static final String RESTSHARP = "restsharp"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index ab5cd5bb3d0..b6e54b0fa21 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -56,7 +56,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // Project Variable, determined from target framework. Not intended to be user-settable. protected static final String TARGET_FRAMEWORK_VERSION = "targetFrameworkVersion"; - @SuppressWarnings({"hiding"}) + @SuppressWarnings("hiding") private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); private static final List frameworkStrategies = Arrays.asList( FrameworkStrategy.NETSTANDARD_1_3, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index 1ed37650f7f..edb5f81cd0d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -55,7 +55,7 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf outputFolder = "docs"; embeddedTemplateDir = templateDir = "confluenceWikiDocs"; - defaultIncludes = new HashSet(); + defaultIncludes = new HashSet<>(); cliOptions.add(new CliOption("appName", "short name of the application")); cliOptions.add(new CliOption("appDescription", "description of the application")); @@ -80,10 +80,10 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); supportingFiles.add(new SupportingFile("index.mustache", "", "confluence-markup.txt")); - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); - languageSpecificPrimitives = new HashSet(); - importMapping = new HashMap(); + languageSpecificPrimitives = new HashSet<>(); + importMapping = new HashMap<>(); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 0aa6cb25685..4ab177e21a3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -116,10 +116,10 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { supportingFiles.add(new SupportingFile("cmake.mustache", "", "CMakeLists.txt")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("int", "char", "bool", "long", "float", "double", "int32_t", "int64_t")); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("date", "std::string"); typeMapping.put("DateTime", "std::string"); typeMapping.put("string", "std::string"); @@ -137,7 +137,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { typeMapping.put("URI", "std::string"); typeMapping.put("ByteArray", "std::string"); - super.importMapping = new HashMap(); + super.importMapping = new HashMap<>(); importMapping.put("std::vector", "#include "); importMapping.put("std::map", "#include "); importMapping.put("std::string", "#include "); @@ -290,14 +290,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { //TODO: This changes the info about the real type but it is needed to parse the header params if (param.isHeaderParam) { - param.dataType = "Pistache::Optional"; - param.baseType = "Pistache::Optional"; + param.dataType = "std::optional"; + param.baseType = "std::optional"; } else if (param.isQueryParam) { if (param.isPrimitiveType) { - param.dataType = "Pistache::Optional<" + param.dataType + ">"; + param.dataType = "std::optional<" + param.dataType + ">"; } else { - param.dataType = "Pistache::Optional<" + param.dataType + ">"; - param.baseType = "Pistache::Optional<" + param.baseType + ">"; + param.dataType = "std::optional<" + param.dataType + ">"; + param.baseType = "std::optional<" + param.baseType + ">"; } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java index 859ab9d69cd..cef3b403961 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java @@ -22,13 +22,13 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements protected static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api)."; protected static final String CONTENT_COMPRESSION_ENABLED = "contentCompression"; protected static final String CONTENT_COMPRESSION_ENABLED_DESC = "Enable Compressed Content Encoding for requests and responses"; - protected Set foundationClasses = new HashSet(); + protected Set foundationClasses = new HashSet<>(); protected String cppNamespace = "OpenAPI"; - protected Map namespaces = new HashMap(); - protected Set systemIncludes = new HashSet(); + protected Map namespaces = new HashMap<>(); + protected Set systemIncludes = new HashSet<>(); protected boolean isContentCompressionEnabled = false; - protected Set nonFrameworkPrimitives = new HashSet(); + protected Set nonFrameworkPrimitives = new HashSet<>(); public CppQtAbstractCodegen() { super(); @@ -75,7 +75,7 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements * Language Specific Primitives. These types will not trigger imports by * the client generator */ - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "qint32", @@ -93,7 +93,7 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements "QByteArray") ); languageSpecificPrimitives.addAll(foundationClasses); - super.typeMapping = new HashMap(); + super.typeMapping = new HashMap<>(); typeMapping.put("date", "QDate"); typeMapping.put("DateTime", "QDateTime"); @@ -116,8 +116,8 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements typeMapping.put("URI", "QString"); typeMapping.put("file", "QByteArray"); typeMapping.put("binary", "QByteArray"); - importMapping = new HashMap(); - namespaces = new HashMap(); + importMapping = new HashMap<>(); + namespaces = new HashMap<>(); systemIncludes.add("QString"); systemIncludes.add("QList"); @@ -315,7 +315,7 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements List operations = (List) objectMap.get("operation"); List> imports = (List>) objs.get("imports"); - Map codegenModels = new HashMap(); + Map codegenModels = new HashMap<>(); for (Object moObj : allModels) { CodegenModel mo = ((Map) moObj).get("model"); @@ -336,7 +336,7 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements imports.add(createMapping("import", operation.returnBaseType)); } } - List params = new ArrayList(); + List params = new ArrayList<>(); if (operation.allParams != null) params.addAll(operation.allParams); // Check all parameter baseType if there is a necessity to include, include it if not @@ -375,7 +375,7 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements } private Map createMapping(String key, String value) { - Map customImport = new HashMap(); + Map customImport = new HashMap<>(); customImport.put(key, toModelImport(value)); return customImport; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java index e93ae32541a..5aa46278a9c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @@ -46,6 +46,10 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC .includeSecurityFeatures(SecurityFeature.BasicAuth) .includeSecurityFeatures(SecurityFeature.ApiKey) .includeSecurityFeatures(SecurityFeature.BearerToken) + .includeSecurityFeatures(SecurityFeature.OAuth2_AuthorizationCode) + .includeSecurityFeatures(SecurityFeature.OAuth2_Implicit) + .includeSecurityFeatures(SecurityFeature.OAuth2_ClientCredentials) + .includeSecurityFeatures(SecurityFeature.OAuth2_Password) .includeGlobalFeatures(GlobalFeature.ParameterStyling) ); @@ -96,6 +100,8 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, PREFIX + "Enum.h")); supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, PREFIX + "ServerConfiguration.h")); supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, PREFIX + "ServerVariable.h")); + supportingFiles.add(new SupportingFile("oauth.cpp.mustache", sourceFolder, PREFIX + "Oauth.cpp")); + supportingFiles.add(new SupportingFile("oauth.h.mustache", sourceFolder, PREFIX + "Oauth.h")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt")); if (optionalProjectFileFlag) { @@ -127,6 +133,8 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, modelNamePrefix + "Enum.h")); supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, modelNamePrefix + "ServerConfiguration.h")); supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, modelNamePrefix + "ServerVariable.h")); + supportingFiles.add(new SupportingFile("oauth.cpp.mustache", sourceFolder, modelNamePrefix + "Oauth.cpp")); + supportingFiles.add(new SupportingFile("oauth.h.mustache", sourceFolder, modelNamePrefix + "Oauth.h")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index a72388d4226..078e51a841e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -166,10 +166,10 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { supportingFiles.add(new SupportingFile("cmake-config.mustache", "", "Config.cmake.in")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("int", "char", "bool", "long", "float", "double", "int32_t", "int64_t")); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("date", "utility::datetime"); typeMapping.put("DateTime", "utility::datetime"); typeMapping.put("string", "utility::string_t"); @@ -186,7 +186,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { typeMapping.put("URI", "utility::string_t"); typeMapping.put("ByteArray", "utility::string_t"); - super.importMapping = new HashMap(); + super.importMapping = new HashMap<>(); importMapping.put("std::vector", "#include "); importMapping.put("std::map", "#include "); importMapping.put("std::string", "#include "); @@ -263,7 +263,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { CodegenModel codegenModel = super.fromModel(name, model); Set oldImports = codegenModel.imports; - codegenModel.imports = new HashSet(); + codegenModel.imports = new HashSet<>(); for (String imp : oldImports) { String newImp = toModelImport(imp); if (!newImp.isEmpty()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index ca3e6c02f48..3f21f4adf14 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -93,10 +93,10 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("int", "char", "bool", "long", "float", "double", "int32_t", "int64_t")); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("date", "std::string"); typeMapping.put("DateTime", "std::string"); typeMapping.put("string", "std::string"); @@ -113,7 +113,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { typeMapping.put("URI", "std::string"); typeMapping.put("ByteArray", "std::string"); - super.importMapping = new HashMap(); + super.importMapping = new HashMap<>(); importMapping.put("std::vector", "#include "); importMapping.put("std::map", "#include "); importMapping.put("std::string", "#include "); @@ -129,7 +129,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { // Clean interfaces of ambiguity for (Entry cm : allModels.entrySet()) { if (cm.getValue().getInterfaces() != null && !cm.getValue().getInterfaces().isEmpty()) { - List newIntf = new ArrayList(cm.getValue().getInterfaces()); + List newIntf = new ArrayList<>(cm.getValue().getInterfaces()); for (String intf : allModels.get(cm.getKey()).getInterfaces()) { if (allModels.get(intf).getInterfaces() != null && !allModels.get(intf).getInterfaces().isEmpty()) { @@ -256,7 +256,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { CodegenModel codegenModel = super.fromModel(name, model); Set oldImports = codegenModel.imports; - codegenModel.imports = new HashSet(); + codegenModel.imports = new HashSet<>(); for (String imp : oldImports) { String newImp = toModelImport(imp); if (!newImp.isEmpty()) { @@ -285,7 +285,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); - List newOpList = new ArrayList(); + List newOpList = new ArrayList<>(); for (CodegenOperation op : operationList) { String path = op.path; @@ -318,7 +318,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { final String X_CODEGEN_OTHER_METHODS = "x-codegen-other-methods"; List currentOtherMethodList = (List) op1.vendorExtensions.get(X_CODEGEN_OTHER_METHODS); if (currentOtherMethodList == null) { - currentOtherMethodList = new ArrayList(); + currentOtherMethodList = new ArrayList<>(); } op.operationIdCamelCase = op1.operationIdCamelCase; currentOtherMethodList.add(op); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java index ef5329ad8ea..04e349c9cc7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java @@ -71,7 +71,7 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC } public void addControllerToAdditionalProperties() { - Map supportedControllers = new HashMap(); + Map supportedControllers = new HashMap<>(); supportedControllers.put("esp32", "isESP32"); supportedControllers.put("esp8266", "isESP8266"); if (supportedControllers.containsKey(controller)) { @@ -152,20 +152,19 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC // SERVICES: Helpers supportingFiles.add(new SupportingFile("service/Response.h.mustache", serviceFolder, "Response.h")); - supportingFiles.add(new SupportingFile("service/AbstractService.h.mustache", serviceFolder, "AbstractService.h")); - supportingFiles.add(new SupportingFile("service/AbstractService.cpp.mustache", serviceFolder, "AbstractService.cpp")); + supportingFiles.add(new SupportingFile("service/Service.h.mustache", serviceFolder, "Service.h")); + supportingFiles.add(new SupportingFile("service/Service.cpp.mustache", serviceFolder, "Service.cpp")); // Main - supportingFiles.add(new SupportingFile("main.mustache", CppTinyClientCodegen.sourceFolder, "main.cpp")); + supportingFiles.add(new SupportingFile("main.mustache", CppTinyClientCodegen.sourceFolder, "main.cpp")); // TODO no overwrite // Config files supportingFiles.add(new SupportingFile("README.mustache", rootFolder, "README.md")); - supportingFiles.add(new SupportingFile("platformio.ini.mustache", rootFolder, "platformio.ini")); - supportingFiles.add(new SupportingFile("root.cert.mustache", rootFolder, "root.cert")); - supportingFiles.add(new SupportingFile("README.mustache", rootFolder, "README.md")); + supportingFiles.add(new SupportingFile("platformio.ini.mustache", rootFolder, "platformio.ini")); // TODO no overwrite + supportingFiles.add(new SupportingFile("root.cert.mustache", rootFolder, "root.cert")); // TODO no overwrite supportingFiles.add(new SupportingFile("pre_compiling_bourne.py.mustache", rootFolder, "pre_compiling_bourne.py")); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "bool", "int", @@ -173,7 +172,7 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC "double", "float") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "int", @@ -183,7 +182,7 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC "std::string") ); - super.typeMapping = new HashMap(); + super.typeMapping = new HashMap<>(); typeMapping.put("string", "std::string"); typeMapping.put("integer", "int"); typeMapping.put("boolean", "bool"); @@ -232,7 +231,6 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC @Override public void processOpts() { super.processOpts(); - // Throw exception if http and esp8266 // -- --additional-properties=controller= if (additionalProperties.containsKey(MICROCONTROLLER)) { @@ -259,7 +257,7 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC if (languageSpecificPrimitives.contains(openAPIType)) { return toModelName(openAPIType); } else { - return openAPIType + ""; + return openAPIType; } } @@ -316,7 +314,7 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC if (isReservedWord(paramName)) { return escapeReservedWord(paramName); } - return "" + paramName; + return paramName; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java index d23bf246cac..a67bc3f1845 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java @@ -71,7 +71,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen embeddedTemplateDir = templateDir = "cpp-tizen-client"; modelPackage = ""; - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "bool", "int", @@ -79,7 +79,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen "double", "float") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "int", @@ -105,7 +105,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen "unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while", "xor", "xor_eq" )); - super.typeMapping = new HashMap(); + super.typeMapping = new HashMap<>(); //typeMapping.put("Date", "DateTime"); //typeMapping.put("DateTime", "DateTime"); @@ -128,7 +128,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen typeMapping.put("UUID", "std::string"); typeMapping.put("URI", "std::string"); - importMapping = new HashMap(); + importMapping = new HashMap<>(); supportingFiles.clear(); supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, "Helpers.h")); @@ -175,7 +175,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen if (languageSpecificPrimitives.contains(name)) { return name; } else { - return name + ""; + return name; } } @@ -200,7 +200,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen if (languageSpecificPrimitives.contains(openAPIType)) { return toModelName(openAPIType); } else { - return openAPIType + ""; + return openAPIType; } } @@ -295,7 +295,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen if (isReservedWord(paramName)) { return escapeReservedWord(paramName); } - return "" + paramName; + return paramName; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java index 9f3b47c8272..5eb601f0a01 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -39,14 +39,14 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { protected String unrealModuleName = "OpenAPI"; // Will be treated as pointer - protected Set pointerClasses = new HashSet(); + protected Set pointerClasses = new HashSet<>(); // source folder where to write the files protected String privateFolder = "Private"; protected String publicFolder = "Public"; protected String apiVersion = "1.0.0"; - protected Map namespaces = new HashMap(); + protected Map namespaces = new HashMap<>(); // Will be included using the <> syntax, not used in Unreal's coding convention - protected Set systemIncludes = new HashSet(); + protected Set systemIncludes = new HashSet<>(); protected String cppNamespace = unrealModuleName; protected boolean optionalProjectFileFlag = true; @@ -132,7 +132,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { * Language Specific Primitives. These types will not trigger imports by * the client generator */ - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "int32", @@ -159,7 +159,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { supportingFiles.add(new SupportingFile("module-source.mustache", privateFolder, unrealModuleName + "Module.cpp")); } - super.typeMapping = new HashMap(); + super.typeMapping = new HashMap<>(); // Maps C++ types during call to getSchemaType, see DefaultCodegen.getSchemaType and not the types/formats // defined in openapi specification "array" is also used explicitly in the generator for containers @@ -188,10 +188,10 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { typeMapping.put("UUID", "FGuid"); typeMapping.put("AnyType", "TSharedPtr"); - importMapping = new HashMap(); + importMapping = new HashMap<>(); importMapping.put("HttpFileInput", "#include \"" + modelNamePrefix + "Helpers.h\""); - namespaces = new HashMap(); + namespaces = new HashMap<>(); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 203bed47040..0ff2d657e7a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -130,7 +130,7 @@ public class CrystalClientCodegen extends DefaultCodegen { hideGenerationTimestamp = Boolean.TRUE; // reserved word. Ref: https://github.com/crystal-lang/crystal/wiki/Crystal-for-Rubyists#available-keywords - reservedWords = new HashSet( + reservedWords = new HashSet<>( Arrays.asList( "abstract", "do", "if", "nil?", "select", "union", "alias", "else", "in", "of", "self", "unless", @@ -557,8 +557,8 @@ public class CrystalClientCodegen extends DefaultCodegen { public Map postProcessOperationsWithModels(Map objs, List allModels) { objs = super.postProcessOperationsWithModels(objs, allModels); Map operations = (Map) objs.get("operations"); - HashMap modelMaps = new HashMap(); - HashMap processedModelMaps = new HashMap(); + HashMap modelMaps = new HashMap<>(); + HashMap processedModelMaps = new HashMap<>(); for (Object o : allModels) { HashMap h = (HashMap) o; @@ -870,7 +870,7 @@ public class CrystalClientCodegen extends DefaultCodegen { } // only process files with cr extension if ("cr".equals(FilenameUtils.getExtension(file.toString()))) { - String command = crystalPostProcessFile + " " + file.toString(); + String command = crystalPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); @@ -882,7 +882,7 @@ public class CrystalClientCodegen extends DefaultCodegen { while ((line = br.readLine()) != null) { sb.append(line); } - LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString()); + LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb); } } else { LOGGER.info("Successfully executed: {}", command); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 78c1235c9df..9903908d4e0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -116,7 +116,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * Reserved words. Override this with reserved words specific to your language * Ref: https://github.com/itsgreggreg/elixir_quick_reference#reserved-words */ - reservedWords = new HashSet( + reservedWords = new HashSet<>( Arrays.asList( "nil", "true", @@ -164,7 +164,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * Language Specific Primitives. These types will not trigger imports by * the client generator */ - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "Integer", "Float", @@ -182,7 +182,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig ); // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("integer", "Integer"); typeMapping.put("long", "Integer"); typeMapping.put("number", "Float"); @@ -727,10 +727,10 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig } sb.append("keyword()) :: "); - HashSet uniqueResponseTypes = new HashSet(); + HashSet uniqueResponseTypes = new HashSet<>(); for (CodegenResponse response : this.responses) { ExtendedCodegenResponse exResponse = (ExtendedCodegenResponse) response; - StringBuilder returnEntry = new StringBuilder(""); + StringBuilder returnEntry = new StringBuilder(); if (exResponse.baseType == null) { returnEntry.append("nil"); } else if (exResponse.simpleType) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index ba89d67819c..20b2ac0c944 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -328,19 +328,17 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { private boolean anyVarMatches(final List> models, final Predicate predicate) { return models.stream() - .map(obj -> (CodegenModel) obj.get("model")) - .flatMap(model -> model.vars.stream()) - .filter(var -> { - CodegenProperty prop = var; - while (prop != null) { - if (predicate.test(prop)) { - return true; + .map(obj -> (CodegenModel) obj.get("model")) + .flatMap(model -> model.vars.stream()).anyMatch(var -> { + CodegenProperty prop = var; + while (prop != null) { + if (predicate.test(prop)) { + return true; + } + prop = prop.items; } - prop = prop.items; - } - return false; - }) - .count() > 0; + return false; + }); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java index bf670711c32..1bc6d6bf8c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java @@ -267,7 +267,7 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen { } // Converts, for example, PUT to HttpPut for controller attributes - operation.httpMethod = "Http" + operation.httpMethod.substring(0, 1) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT); + operation.httpMethod = "Http" + operation.httpMethod.charAt(0) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 662cbfce132..645069903b8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -136,8 +136,8 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected Map> uniqueParamNameTypes = new HashMap<>(); protected Map> modelMimeTypes = new HashMap<>(); protected Map knownMimeDataTypes = new HashMap<>(); - protected Set typeNames = new HashSet(); - protected Set modelTypeNames = new HashSet(); + protected Set typeNames = new HashSet<>(); + protected Set modelTypeNames = new HashSet<>(); final private static Pattern CONTAINS_JSON_MIME_PATTERN = Pattern.compile("(?i)application/.*json(;.*)?"); @@ -235,7 +235,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC supportingFiles.add(new SupportingFile("tests/PropMime.mustache", "tests", "PropMime.hs")); supportingFiles.add(new SupportingFile("tests/Test.mustache", "tests", "Test.hs")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "Bool", "String", @@ -555,7 +555,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC } if (!additionalProperties.containsKey(PROP_BASE_MODULE)) { - List wordsCaps = new ArrayList(); + List wordsCaps = new ArrayList<>(); for (String word : baseTitle.split(" ")) { wordsCaps.add(firstLetterToUpper(word)); } @@ -684,7 +684,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation op, Map> operations) { List opList = operations.get(tag); if (opList == null || opList.isEmpty()) { - opList = new ArrayList(); + opList = new ArrayList<>(); operations.put(tag, opList); } // check for operationId uniqueness @@ -1454,7 +1454,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC // only process files with hs extension if ("hs".equals(FilenameUtils.getExtension(file.toString()))) { - String command = haskellPostProcessFile + " " + file.toString(); + String command = haskellPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index 9887d5c6f1e..9b44c0b2d68 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -169,7 +169,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf * Language Specific Primitives. These types will not trigger imports by * the client generator */ - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "Bool", "String", @@ -286,14 +286,14 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf String[] words = title.split(" "); // The package name is made by appending the lowercased words of the title interspersed with dashes - List wordsLower = new ArrayList(); + List wordsLower = new ArrayList<>(); for (String word : words) { wordsLower.add(word.toLowerCase(Locale.ROOT)); } String cabalName = joinStrings("-", wordsLower); // The API name is made by appending the capitalized words of the title - List wordsCaps = new ArrayList(); + List wordsCaps = new ArrayList<>(); for (String word : words) { wordsCaps.add(firstLetterToUpper(word)); } @@ -446,7 +446,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf // IdType is provided by the capture params. private List pathToServantRoute(String path, List pathParams) { // Map the capture params by their names. - HashMap captureTypes = new HashMap(); + HashMap captureTypes = new HashMap<>(); for (CodegenParameter param : pathParams) { captureTypes.put(param.baseName, param.dataType); } @@ -462,7 +462,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf } // Convert the path into a list of servant route components. - List pathComponents = new ArrayList(); + List pathComponents = new ArrayList<>(); for (String piece : path.split("/")) { if (piece.startsWith("{") && piece.endsWith("}")) { String name = piece.substring(1, piece.length() - 1); @@ -479,7 +479,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf // Extract the arguments that are passed in the route path parameters private List pathToClientType(String path, List pathParams) { // Map the capture params by their names. - HashMap captureTypes = new HashMap(); + HashMap captureTypes = new HashMap<>(); for (CodegenParameter param : pathParams) { captureTypes.put(param.baseName, param.dataType); } @@ -490,7 +490,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf } // Convert the path into a list of servant route components. - List type = new ArrayList(); + List type = new ArrayList<>(); for (String piece : path.split("/")) { if (piece.startsWith("{") && piece.endsWith("}")) { String name = piece.substring(1, piece.length() - 1); @@ -605,8 +605,8 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf String name = string; //Check if it is a reserved word, in which case the underscore is added when property name is generated. if (string.startsWith("_")) { - if (reservedWords.contains(string.substring(1, string.length()))) { - name = string.substring(1, string.length()); + if (reservedWords.contains(string.substring(1))) { + name = string.substring(1); } else if (reservedWordsMappings.containsValue(string)) { name = LEADING_UNDERSCORE.matcher(string).replaceFirst(""); } @@ -685,7 +685,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf // only process files with hs extension if ("hs".equals(FilenameUtils.getExtension(file.toString()))) { - String command = haskellPostProcessFile + " " + file.toString(); + String command = haskellPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java index dea598e0499..736b9d599b1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java @@ -136,7 +136,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen ) ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "Bool", "Int", @@ -359,7 +359,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen private List pathToComponents(String path, List pathParams) { // Map the capture params by their names. - HashMap captureTypes = new HashMap(); + HashMap captureTypes = new HashMap<>(); for (CodegenParameter param : pathParams) { captureTypes.put(param.baseName, param.dataType); } @@ -370,7 +370,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen } // Convert the path into a list of yesod path components. - List components = new ArrayList(); + List components = new ArrayList<>(); for (String piece : path.split("/")) { if (piece.startsWith("{") && piece.endsWith("}")) { String name = piece.substring(1, piece.length() - 1); @@ -412,7 +412,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen List> routes = (List>) additionalProperties.get("routes"); if (routes == null) { - routes = new ArrayList>(); + routes = new ArrayList<>(); additionalProperties.put("routes", routes); } @@ -432,10 +432,10 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen } if (!found) { - Map route = new HashMap(); + Map route = new HashMap<>(); route.put("path", path); route.put("resource", resource); - List methods = new ArrayList(); + List methods = new ArrayList<>(); methods.add(op.httpMethod); route.put("methods", methods); routes.add(route); @@ -534,8 +534,8 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen String name = string; //Check if it is a reserved word, in which case the underscore is added when property name is generated. if (string.startsWith("_")) { - if (reservedWords.contains(string.substring(1, string.length()))) { - name = string.substring(1, string.length()); + if (reservedWords.contains(string.substring(1))) { + name = string.substring(1); } else if (reservedWordsMappings.containsValue(string)) { name = LEADING_UNDERSCORE.matcher(string).replaceFirst(""); } @@ -614,7 +614,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen // only process files with hs extension if ("hs".equals(FilenameUtils.getExtension(file.toString()))) { - String command = haskellPostProcessFile + " " + file.toString(); + String command = haskellPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java index cec0fdeccaa..bad912d9a8f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java @@ -133,7 +133,7 @@ public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig /* * Reserved words. Override this with reserved words specific to your language */ - reservedWords = new HashSet( + reservedWords = new HashSet<>( Arrays.asList( "sample1", // replace with static values "sample2") 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 46aa7960c1b..a47161d8460 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 @@ -70,7 +70,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - updateOption(this.DATE_LIBRARY, this.getDateLibrary()); + updateOption(DATE_LIBRARY, this.getDateLibrary()); // clear model and api doc template as this codegen // does not support auto-generated markdown doc at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java index a02e91ad0f8..82dbc6a26ed 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java @@ -655,7 +655,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF var.addTestData(randomBigDecimal); } } else { - buffer.append(randomBigDecimal.toString()).append('D'); + buffer.append(randomBigDecimal).append('D'); } } } @@ -1294,7 +1294,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF if (testDataCache.root().isDirty()) { ByteArrayOutputStream out = new ByteArrayOutputStream(); testDataCache.root().flush(out); - String testDataJson = new String(out.toByteArray(), "UTF-8"); + String testDataJson = out.toString("UTF-8"); objs.put("test-data.json", testDataJson); supportingFiles.add(new SupportingFile("testData.mustache", testDataFile.getAbsolutePath())); } @@ -1306,7 +1306,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF if (testDataControlCache.root().isDirty()) { ByteArrayOutputStream out = new ByteArrayOutputStream(); testDataControlCache.root().flush(out); - String testDataControlJson = new String(out.toByteArray(), "UTF-8"); + String testDataControlJson = out.toString("UTF-8"); objs.put("test-data-control.json", testDataControlJson); supportingFiles .add(new SupportingFile("testDataControl.mustache", testDataControlFile.getAbsolutePath())); 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 1e2740f1858..0d9266020ac 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 @@ -806,6 +806,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen model.imports.remove("JsonSerialize"); model.imports.remove("ToStringSerializer"); } + + if ("set".equals(property.containerType) && !JACKSON.equals(serializationLibrary)) { + // clean-up + model.imports.remove("JsonDeserialize"); + property.vendorExtensions.remove("x-setter-extra-annotation"); + } } @Override 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 22f1567f3b5..5bc602fc9aa 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 @@ -65,7 +65,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen { updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - updateOption(this.DATE_LIBRARY, this.getDateLibrary()); + updateOption(DATE_LIBRARY, this.getDateLibrary()); additionalProperties.put("title", title); // java inflector uses the jackson lib diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java index df5073d8d92..c8516efc020 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java @@ -116,7 +116,7 @@ public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements B .ifPresent(v -> cliOptions.remove(v)); // Add reserved words - String[] reservedWordsArray = new String[]{ + String[] reservedWordsArray = { "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie", "authorization", "body", "application" }; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java index b6b3d0bb793..90c3d3b4ff4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java @@ -471,7 +471,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { // get vendor extensions Map vendorExt = openAPI.getInfo().getExtensions(); - if (vendorExt != null && !vendorExt.toString().equals("")) { + if (vendorExt != null && !vendorExt.toString().isEmpty()) { if (vendorExt.containsKey("x-codegen")) { Map uris = (Map) vendorExt.get("x-codegen"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java index 5f44517c5c0..fe6e26a230d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java @@ -52,7 +52,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen { // clioOptions default redefinition need to be updated updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); - updateOption(this.DATE_LIBRARY, this.getDateLibrary()); + updateOption(DATE_LIBRARY, this.getDateLibrary()); apiTestTemplateFiles.clear(); // TODO: add test template diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java index e8b58b6e81c..e2fc4de08d6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java @@ -95,7 +95,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { updateOption(CodegenConstants.ARTIFACT_VERSION, this.getArtifactVersion()); updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - updateOption(this.DATE_LIBRARY, this.getDateLibrary()); + updateOption(DATE_LIBRARY, this.getDateLibrary()); additionalProperties.put(ROOT_PACKAGE, rootPackage); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java index 28028afbc62..32b601491d3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java @@ -49,7 +49,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod public static final String EMIT_JS_DOC = "emitJSDoc"; public static final String NPM_REPOSITORY = "npmRepository"; - final String[][] JAVASCRIPT_SUPPORTING_FILES = new String[][]{ + final String[][] JAVASCRIPT_SUPPORTING_FILES = { new String[]{"package.mustache", "package.json"}, // new String[]{"index.mustache", "src/index.js", }, // new String[]{"ApiClient.mustache", "src/ApiClient.js"}, @@ -59,7 +59,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod new String[]{"travis.yml", ".travis.yml"} }; - final String[][] JAVASCRIPT_ES6_SUPPORTING_FILES = new String[][]{ + final String[][] JAVASCRIPT_ES6_SUPPORTING_FILES = { new String[]{"package.mustache", "package.json"}, // new String[]{"index.mustache", "src/index.js"}, // new String[]{"ApiClient.mustache", "src/ApiClient.js"}, @@ -132,10 +132,10 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod "prototype", "String", "toString", "undefined", "valueOf") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("String", "Boolean", "Number", "Array", "Object", "Date", "File", "Blob") ); - defaultIncludes = new HashSet(languageSpecificPrimitives); + defaultIncludes = new HashSet<>(languageSpecificPrimitives); instantiationTypes.put("array", "Array"); instantiationTypes.put("list", "Array"); @@ -1127,7 +1127,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod // only process files with js extension if ("js".equals(FilenameUtils.getExtension(file.toString()))) { - String command = jsPostProcessFile + " " + file.toString(); + String command = jsPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 71f0711bc5d..4e9ddd2a007 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -51,7 +51,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo public static final String USE_ES6 = "useES6"; public static final String NPM_REPOSITORY = "npmRepository"; - final String[][] JAVASCRIPT_SUPPORTING_FILES = new String[][]{ + final String[][] JAVASCRIPT_SUPPORTING_FILES = { new String[]{"package.mustache", "package.json"}, // new String[]{"index.mustache", "src/index.js", }, // new String[]{"ApiClient.mustache", "src/ApiClient.js"}, @@ -62,7 +62,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo new String[]{"gitignore.mustache", ".gitignore"} }; - final String[][] JAVASCRIPT_ES6_SUPPORTING_FILES = new String[][]{ + final String[][] JAVASCRIPT_ES6_SUPPORTING_FILES = { new String[]{"package.mustache", "package.json"}, // new String[]{"index.mustache", "src/index.js"}, // new String[]{"ApiClient.mustache", "src/ApiClient.js"}, @@ -135,10 +135,10 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo "prototype", "String", "toString", "undefined", "valueOf") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("String", "Boolean", "Number", "Array", "Object", "Date", "File", "Blob") ); - defaultIncludes = new HashSet(languageSpecificPrimitives); + defaultIncludes = new HashSet<>(languageSpecificPrimitives); instantiationTypes.put("array", "Array"); instantiationTypes.put("set", "Array"); @@ -1212,7 +1212,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo // only process files with js extension if ("js".equals(FilenameUtils.getExtension(file.toString()))) { - String command = jsPostProcessFile + " " + file.toString(); + String command = jsPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java index e66420e2635..edc3c21e4d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java @@ -55,16 +55,16 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem "short", "try", "char", "final", "interface", "static", "void", "class", "finally", "const", "super", "while")); - languageSpecificPrimitives = new HashSet(Arrays.asList( - "string", - "boolean", - "number", - "Object", - "Blob", - "Date")); + languageSpecificPrimitives = new HashSet<>(Arrays.asList( + "string", + "boolean", + "number", + "Object", + "Blob", + "Date")); instantiationTypes.put("array", "Array"); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("Array", "Array"); typeMapping.put("array", "Array"); typeMapping.put("List", "Array"); @@ -86,11 +86,11 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem typeMapping.put("map", "Object"); typeMapping.put("DateTime", "Date"); - importMapping = new HashMap(); - defaultIncludes = new HashSet(Arrays.asList( - "Object", - "Array", - "Blob" + importMapping = new HashMap<>(); + defaultIncludes = new HashSet<>(Arrays.asList( + "Object", + "Array", + "Blob" )); typeMapping.put("binary", "string"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java index da4193b0173..c82f5e1c68e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java @@ -64,7 +64,7 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo "Math", "NaN", "Number", "Object", "prototype", "String", "toString", "undefined", "valueOf")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList("string", "boolean", "number", "Array", "Object", "Date", "File", "Blob") ); @@ -95,7 +95,7 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo typeMapping.put("UUID", "string"); typeMapping.put("URI", "string"); - defaultIncludes = new HashSet(languageSpecificPrimitives); + defaultIncludes = new HashSet<>(languageSpecificPrimitives); outputFolder = "generated-code/javascript-flowtyped"; embeddedTemplateDir = templateDir = "Javascript-Flowtyped"; @@ -173,14 +173,14 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo // name enum with model name, e.g. StatusEnum => Pet.StatusEnum for (CodegenProperty var : cm.vars) { if (Boolean.TRUE.equals(var.isEnum)) { - var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + "" + var.enumName); + var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + var.enumName); } } if (cm.parent != null) { for (CodegenProperty var : cm.allVars) { if (Boolean.TRUE.equals(var.isEnum)) { var.datatypeWithEnum = var.datatypeWithEnum - .replace(var.enumName, cm.classname + "" + var.enumName); + .replace(var.enumName, cm.classname + var.enumName); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index 002084bc616..bf3cf05c81e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -141,7 +141,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { .map(x -> quoteExample( StringEscapeUtils.escapeEcmaScript( String.valueOf(x.getValue())))) - .collect(Collectors.toCollection(() -> new TreeSet())); + .collect(Collectors.toCollection(() -> new TreeSet<>())); if (!exampleValues.isEmpty()) { @@ -274,7 +274,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String BASE_URL = "baseURL"; public static final String PRESERVE_LEADING_PARAM_CHAR = "preserveLeadingParamChar"; static final Collection INVOKER_PKG_SUPPORTING_FILES = Arrays.asList("script.mustache", "README.mustache"); - static final String[][] JAVASCRIPT_SUPPORTING_FILES = new String[][]{ + static final String[][] JAVASCRIPT_SUPPORTING_FILES = { new String[]{"script.mustache", "script.js"}, new String[]{"README.mustache", "README.md"}}; protected String projectName; @@ -412,7 +412,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { List queryParams = new ArrayList<>(); List bodyOrFormParams = new ArrayList<>(); List k6Checks = new ArrayList<>(); - Set imports = new HashSet(); + Set imports = new HashSet<>(); final Operation operation = methodOperation.getValue(); final PathItem.HttpMethod method = methodOperation.getKey(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 39e2d1cfac8..91e3ce32c3f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -372,13 +372,18 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { } if (usesRetrofit2Library()) { - if (ProcessUtils.hasOAuthMethods(openAPI)) { - supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.kt.mustache", authFolder, "ApiKeyAuth.kt")); + boolean hasOAuthMethods = ProcessUtils.hasOAuthMethods(openAPI); + + if (hasOAuthMethods) { supportingFiles.add(new SupportingFile("auth/OAuth.kt.mustache", authFolder, "OAuth.kt")); supportingFiles.add(new SupportingFile("auth/OAuthFlow.kt.mustache", authFolder, "OAuthFlow.kt")); supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.kt.mustache", authFolder, "OAuthOkHttpClient.kt")); } + if (hasOAuthMethods || ProcessUtils.hasApiKeyMethods(openAPI)) { + supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.kt.mustache", authFolder, "ApiKeyAuth.kt")); + } + if (ProcessUtils.hasHttpBearerMethods(openAPI)) { supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.kt.mustache", authFolder, "HttpBearerAuth.kt")); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 93d7428c236..8960b2f8e69 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -454,7 +454,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen basePath = basePath.substring(0, pos); } - if (basePath.equals("")) { + if (basePath.isEmpty()) { basePath = "default"; } else { co.subresourceOperation = !co.path.isEmpty(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java index 2db0bd7af88..876a1b3b479 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java @@ -1055,7 +1055,7 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { // identifier name cannot be empty if (escapedName.isEmpty()) { - throw new RuntimeException("Empty database/table/column name for property '" + name.toString() + "' not allowed"); + throw new RuntimeException("Empty database/table/column name for property '" + name + "' not allowed"); } return escapedName; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java index 40f2cb23c05..795b829036a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java @@ -111,13 +111,13 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "nil", "string", @@ -150,7 +150,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("ByteArray", "string"); typeMapping.put("object", "TODO_OBJECT_MAPPING"); - importMapping = new HashMap(); + importMapping = new HashMap<>(); importMapping.put("time.Time", "time"); importMapping.put("*os.File", "os"); importMapping.put("os", "io/ioutil"); @@ -508,7 +508,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { } public Map createMapping(String key, String value) { - Map customImport = new HashMap(); + Map customImport = new HashMap<>(); customImport.put(key, value); return customImport; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java index 36b635f26ae..3a3e081f7b8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java @@ -97,7 +97,7 @@ public class MarkdownDocumentationCodegen extends DefaultCodegen implements Code public String toParamName(String name) { if (reservedWords.contains(name)) { return escapeReservedWord(name); - } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character)))) { + } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character)))) { return escape(name, specialCharReplacements, null, null); } return name; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index fa217e1635f..97748d8d6db 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -41,19 +41,19 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig public static final Integer ENUM_MAX_ELEMENTS = 65535; public static final Integer IDENTIFIER_MAX_LENGTH = 64; - protected Vector mysqlNumericTypes = new Vector(Arrays.asList( + protected Vector mysqlNumericTypes = new Vector<>(Arrays.asList( "BIGINT", "BIT", "BOOL", "BOOLEAN", "DEC", "DECIMAL", "DOUBLE", "DOUBLE PRECISION", "FIXED", "FLOAT", "INT", "INTEGER", "MEDIUMINT", "NUMERIC", "REAL", "SMALLINT", "TINYINT" )); - protected Vector mysqlDateAndTimeTypes = new Vector(Arrays.asList( + protected Vector mysqlDateAndTimeTypes = new Vector<>(Arrays.asList( "DATE", "DATETIME", "TIME", "TIMESTAMP", "YEAR" )); - protected Vector mysqlStringTypes = new Vector(Arrays.asList( + protected Vector mysqlStringTypes = new Vector<>(Arrays.asList( "BINARY", "BLOB", "CHAR", "CHAR BYTE", "CHARACTER", "ENUM", "LONGBLOB", "LONGTEXT", "MEDIUMBLOB", "MEDIUMTEXT", "SET", "TEXT", "TINYBLOB", "TINYTEXT", "VARBINARY", "VARCHAR" )); - protected Vector mysqlSpatialTypes = new Vector(Arrays.asList( + protected Vector mysqlSpatialTypes = new Vector<>(Arrays.asList( "GEOMETRY", "GEOMETRYCOLLECTION", "LINESTRING", "MULTILINESTRING", "MULTIPOINT", "MULTIPOLYGON", "POINT", "POLYGON" )); @@ -125,7 +125,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig ); // all types can be threaded as primitives except array, object and refs - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "boolean", @@ -263,8 +263,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig String tableName = this.toTableName(modelName); String modelDescription = model.getDescription(); Map modelVendorExtensions = model.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map tableDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map tableDefinition = new HashMap<>(); if (this.getIdentifierNamingConvention().equals("snake_case") && !modelName.equals(tableName)) { // add original name in table comment @@ -325,8 +325,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processIntegerTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); @@ -366,7 +366,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn( "ENUM column can have maximum of {} distinct elements, following value will be skipped: {}", - ENUM_MAX_ELEMENTS.toString(), (String) enumValues.get(i)); + ENUM_MAX_ELEMENTS, (String) enumValues.get(i)); break; } String value = String.valueOf(enumValues.get(i)); @@ -417,8 +417,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processDecimalTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); @@ -457,7 +457,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn( "ENUM column can have maximum of {} distinct elements, following value will be skipped: {}", - ENUM_MAX_ELEMENTS.toString(), (String) enumValues.get(i)); + ENUM_MAX_ELEMENTS, (String) enumValues.get(i)); break; } String value = String.valueOf(enumValues.get(i)); @@ -507,8 +507,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processBooleanTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); @@ -562,8 +562,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processStringTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); @@ -601,7 +601,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn( "ENUM column can have maximum of {} distinct elements, following value will be skipped: {}", - ENUM_MAX_ELEMENTS.toString(), (String) enumValues.get(i)); + ENUM_MAX_ELEMENTS, (String) enumValues.get(i)); break; } String value = String.valueOf(enumValues.get(i)); @@ -645,8 +645,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processDateTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); String dataType = property.getDataType(); @@ -698,8 +698,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processJsonTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); String dataType = property.getDataType(); @@ -755,8 +755,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public void processUnknownTypeProperty(CodegenModel model, CodegenProperty property) { Map vendorExtensions = property.getVendorExtensions(); - Map mysqlSchema = new HashMap(); - Map columnDefinition = new HashMap(); + Map mysqlSchema = new HashMap<>(); + Map columnDefinition = new HashMap<>(); String baseName = property.getBaseName(); String colName = this.toColumnName(baseName); Boolean required = property.getRequired(); @@ -806,7 +806,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig * @return generated codegen property */ public HashMap toCodegenMysqlDataTypeArgument(Object value) { - HashMap arg = new HashMap(); + HashMap arg = new HashMap<>(); if (value instanceof String) { arg.put("isString", true); arg.put("isFloat", false); @@ -838,7 +838,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig * @return generated codegen property */ public HashMap toCodegenMysqlDataTypeDefault(String defaultValue, String mysqlDataType) { - HashMap defaultMap = new HashMap(); + HashMap defaultMap = new HashMap<>(); if (defaultValue == null || defaultValue.toUpperCase(Locale.ROOT).equals("NULL")) { defaultMap.put("defaultValue", "NULL"); defaultMap.put("isString", false); @@ -1076,7 +1076,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig // identifier name cannot be empty if (escapedName.isEmpty()) { - throw new RuntimeException("Empty database/table/column name for property '" + name.toString() + "' not allowed"); + throw new RuntimeException("Empty database/table/column name for property '" + name + "' not allowed"); } return escapedName; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index c81bccd718a..572cbacc66f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -117,13 +117,13 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "array" ) ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "int", "int8", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java index de51e636a83..3af6d99b96f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -439,7 +439,7 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege // only process files with js extension if ("js".equals(FilenameUtils.getExtension(file.toString()))) { - String command = jsPostProcessFile + " " + file.toString(); + String command = jsPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index ad061e72c06..3b62750ae02 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -672,7 +672,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig public String toEnumValueName(String name) { if (reservedWords.contains(name)) { return escapeReservedWord(name); - } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character)))) { + } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character)))) { return escape(name, specialCharReplacements, Collections.singletonList("_"), null); } else { return name; @@ -812,7 +812,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig } // only process files with ml or mli extension if ("ml".equals(FilenameUtils.getExtension(file.toString())) || "mli".equals(FilenameUtils.getExtension(file.toString()))) { - String command = ocamlPostProcessFile + " " + file.toString(); + String command = ocamlPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 562f1a5b3fd..0075bcb8a57 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -43,7 +43,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String DEFAULT_LICENSE = "Proprietary"; public static final String CORE_DATA = "coreData"; - protected Set foundationClasses = new HashSet(); + protected Set foundationClasses = new HashSet<>(); protected String podName = "OpenAPIClient"; protected String podVersion = "1.0.0"; protected String classPrefix = "OAI"; @@ -60,7 +60,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { protected boolean generateCoreData = false; - protected Set advancedMappingTypes = new HashSet(); + protected Set advancedMappingTypes = new HashSet<>(); public ObjcClientCodegen() { super(); @@ -185,9 +185,9 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { "description", "class" )); - importMapping = new HashMap(); + importMapping = new HashMap<>(); - foundationClasses = new HashSet( + foundationClasses = new HashSet<>( Arrays.asList( "NSNumber", "NSObject", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 7af1f4e36b3..2a4a8d1905f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -614,7 +614,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { if ("t".equals(FilenameUtils.getExtension(file.toString())) || "pm".equals(FilenameUtils.getExtension(file.toString())) || "pl".equals(FilenameUtils.getExtension(file.toString()))) { - String command = perlTidyPath + " -b -bext='/' " + file.toString(); + String command = perlTidyPath + " -b -bext='/' " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index 3c33950a034..a6efee11fb1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -90,7 +90,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); // ref: http://php.net/manual/en/language.types.intro.php - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "boolean", "int", @@ -108,7 +108,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf instantiationTypes.put("map", "map"); // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("integer", "int"); typeMapping.put("long", "int"); typeMapping.put("float", "float"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 17d970d39c5..7ffaf723136 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -113,7 +113,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg outputFolder = "generated-code" + File.separator + "php"; apiTemplateFiles.put("api_controller.mustache", ".php"); modelTestTemplateFiles.put("testing/model_test.mustache", ".php"); - apiTestTemplateFiles = new HashMap(); + apiTestTemplateFiles = new HashMap<>(); apiTestTemplateFiles.put("testing/api_test.mustache", ".php"); embeddedTemplateDir = templateDir = "php-symfony"; @@ -139,7 +139,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg ); // ref: http://php.net/manual/en/language.types.intro.php - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "int", @@ -157,7 +157,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "\\DateTime", "UploadedFile" @@ -167,13 +167,13 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg variableNamingConvention = "camelCase"; // provide primitives to mustache template - List sortedLanguageSpecificPrimitives = new ArrayList(languageSpecificPrimitives); + List sortedLanguageSpecificPrimitives = new ArrayList<>(languageSpecificPrimitives); Collections.sort(sortedLanguageSpecificPrimitives); String primitives = "'" + StringUtils.join(sortedLanguageSpecificPrimitives, "', '") + "'"; additionalProperties.put("primitives", primitives); // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("integer", "int"); typeMapping.put("long", "int"); typeMapping.put("decimal", "float"); @@ -370,13 +370,13 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg // Type-hintable primitive types // ref: http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration if (phpLegacySupport) { - typeHintable = new HashSet( + typeHintable = new HashSet<>( Arrays.asList( "array" ) ); } else { - typeHintable = new HashSet( + typeHintable = new HashSet<>( Arrays.asList( "array", "bool", @@ -396,7 +396,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg operations.put("controllerName", toControllerName((String) operations.get("pathPrefix"))); operations.put("symfonyService", toSymfonyService((String) operations.get("pathPrefix"))); - List authMethods = new ArrayList(); + List authMethods = new ArrayList<>(); List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 58e12fff701..f55734fafa2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -109,7 +109,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo modelPackage = packageName + File.separator + "Model"; // https://blogs.msdn.microsoft.com/powershell/2010/01/07/how-objects-are-sent-to-and-from-remote-sessions/ - languageSpecificPrimitives = new HashSet(Arrays.asList( + languageSpecificPrimitives = new HashSet<>(Arrays.asList( "Byte", "SByte", "Byte[]", @@ -136,9 +136,9 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo "Version" )); - commonVerbs = new HashMap(); + commonVerbs = new HashMap<>(); - Map> verbMappings = new HashMap>(); + Map> verbMappings = new HashMap<>(); // common verbMappings.put("Add", Arrays.asList("Append", "Attach", "Concatenate", "Insert")); @@ -266,7 +266,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo } } - powershellVerbs = new HashSet(Arrays.asList( + powershellVerbs = new HashSet<>(Arrays.asList( "Add", "Clear", "Close", @@ -368,9 +368,9 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo "Use" )); - methodNames = new HashSet(); + methodNames = new HashSet<>(); - nullablePrimitives = new HashSet(Arrays.asList( + nullablePrimitives = new HashSet<>(Arrays.asList( "System.Nullable[Byte]", "System.Nullable[SByte]", "System.Nullable[Int16]", @@ -386,7 +386,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo )); // list of reserved words - must be in lower case - reservedWords = new HashSet(Arrays.asList( + reservedWords = new HashSet<>(Arrays.asList( // https://richardspowershellblog.wordpress.com/2009/05/02/powershell-reserved-words/ "begin", "break", @@ -456,7 +456,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo "true" )); - paramNameReservedWords = new HashSet(Arrays.asList( + paramNameReservedWords = new HashSet<>(Arrays.asList( "args", "error", "executioncontext", @@ -480,7 +480,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo "true" )); - defaultIncludes = new HashSet(Arrays.asList( + defaultIncludes = new HashSet<>(Arrays.asList( "Byte", "SByte", "Byte[]", @@ -507,7 +507,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo "Version" )); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("string", "String"); typeMapping.put("boolean", "Boolean"); typeMapping.put("integer", "Int32"); @@ -1012,8 +1012,8 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo @Override public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); - HashMap modelMaps = new HashMap(); - HashMap processedModelMaps = new HashMap(); + HashMap modelMaps = new HashMap<>(); + HashMap processedModelMaps = new HashMap<>(); for (Object o : allModels) { HashMap h = (HashMap) o; @@ -1185,10 +1185,10 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo if (codegenParameter.items.isModel) { String modelExample = constructExampleCode(codegenParameter.items, modelMaps, processedModelMap, requiredOnly); if (!StringUtils.isEmpty(modelExample)) { - example.append(modelExample + "\n"); + example.append(modelExample).append("\n"); } - example.append("$" + codegenParameter.paramName + " = @{ key_example = $" + codegenParameter.items.dataType + " }"); + example.append("$").append(codegenParameter.paramName).append(" = @{ key_example = $").append(codegenParameter.items.dataType).append(" }"); } else { example.append("@{ key_example = "); example.append(constructExampleCode(codegenParameter.items, modelMaps, processedModelMap, requiredOnly)); @@ -1280,7 +1280,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo if (codegenProperty.isModel) { String modelExample = constructExampleCode(codegenProperty, modelMaps, processedModelMap, requiredOnly); if (!StringUtils.isEmpty(modelExample)) { - example.append(modelExample + "\n"); + example.append(modelExample).append("\n"); } propertyExamples.add("-" + codegenProperty.name + " " + "$" + codegenProperty.dataType); @@ -1293,26 +1293,26 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo } if (!StringUtils.isEmpty(modelExample)) { - example.append(modelExample + "\n"); + example.append(modelExample).append("\n"); } propertyExamples.add("-" + codegenProperty.name + " " + "$" + codegenProperty.complexType); } else if (codegenProperty.isArray && codegenProperty.items.isString) { if (codegenProperty.items.isEnum || (codegenProperty.items.allowableValues != null && !codegenProperty.items.allowableValues.isEmpty())) { example.append(constructEnumExample(codegenProperty.items.allowableValues)); - propertyExamples.add("-" + codegenProperty.name + " " + example.toString()); + propertyExamples.add("-" + codegenProperty.name + " " + example); } else { StringBuilder stringArrayPropertyValue = new StringBuilder(); String genericStringExample = codegenProperty.items.name + "_example"; stringArrayPropertyValue.append(constructStringExample(codegenProperty.name, codegenProperty.items.example, genericStringExample)); - propertyExamples.add("-" + codegenProperty.name + " " + stringArrayPropertyValue.toString()); + propertyExamples.add("-" + codegenProperty.name + " " + stringArrayPropertyValue); } } else if (codegenProperty.isMap && codegenProperty.items.isModel) { String modelExample = constructExampleCode(codegenProperty.items, modelMaps, processedModelMap, requiredOnly); if (!StringUtils.isEmpty(modelExample)) { - example.append(modelExample + "\n"); + example.append(modelExample).append("\n"); } propertyExamples.add("-" + codegenProperty.name + " " + "@{ key_example = " + "$" + codegenProperty.complexType + " }"); @@ -1327,7 +1327,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo } else { example.append(codegenModel.name); } - example.append(" = " + this.modelsCmdletVerb + "-"); + example.append(" = ").append(this.modelsCmdletVerb).append("-"); if (this.useClassNameInModelsExamples) { example.append(codegenModel.classname); } else { @@ -1353,7 +1353,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo codegenExample.equals("null") || codegenExample.equals(genericStringExample) ) { - example.append("My" + codegenName); + example.append("My").append(codegenName); } else { example.append(codegenExample); } @@ -1369,7 +1369,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo example.append("\""); List enumValues = (List) allowableValues.get("values"); - example.append(String.valueOf(enumValues.get(0))); + example.append(enumValues.get(0)); example.append("\""); @@ -1474,7 +1474,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo // only process files with ps extension if ("ps".equals(FilenameUtils.getExtension(file.toString()))) { - String command = powershellPostProcessFile + " " + file.toString(); + String command = powershellPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 02a01627dd6..f04a58fcf42 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -86,13 +86,13 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf modelPackage = "messages"; apiPackage = "services"; - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "map", "array", 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 7b66ec98a39..6273a453183 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 @@ -611,12 +611,12 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { ComposedSchema cs = (ComposedSchema) schema; // these are the properties that are from properties in self cs or cs allOf - Map selfProperties = new LinkedHashMap(); - List selfRequired = new ArrayList(); + Map selfProperties = new LinkedHashMap<>(); + List selfRequired = new ArrayList<>(); // these are the properties that are from properties in cs oneOf or cs anyOf - Map otherProperties = new LinkedHashMap(); - List otherRequired = new ArrayList(); + Map otherProperties = new LinkedHashMap<>(); + List otherRequired = new ArrayList<>(); List oneOfanyOfSchemas = new ArrayList<>(); List oneOf = cs.getOneOf(); @@ -631,7 +631,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); addProperties(otherProperties, otherRequired, refSchema); } - Set otherRequiredSet = new HashSet(otherRequired); + Set otherRequiredSet = new HashSet<>(otherRequired); List allOf = cs.getAllOf(); if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) { @@ -641,7 +641,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { if (result.discriminator != null) { selfRequired.add(result.discriminator.getPropertyBaseName()); } - Set selfRequiredSet = new HashSet(selfRequired); + Set selfRequiredSet = new HashSet<>(selfRequired); List reqVars = result.getRequiredVars(); List reqVarsThatMustBeOptional = new ArrayList<>(); @@ -668,7 +668,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { protected void addParentContainer(CodegenModel model, String name, Schema schema) { super.addParentContainer(model, name, schema); - List referencedModelNames = new ArrayList(); + List referencedModelNames = new ArrayList<>(); model.dataType = getTypeString(schema, "", "", referencedModelNames); } @@ -688,7 +688,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) { fixComposedSchemaRequiredVars(sc, cm); } - ArrayList> listOfLists = new ArrayList>(); + ArrayList> listOfLists = new ArrayList<>(); listOfLists.add(cm.requiredVars); listOfLists.add(cm.optionalVars); for (List cpList : listOfLists) { @@ -940,7 +940,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { // store it in codegenModel.additionalPropertiesType. // The 'addProps' may be a reference, getTypeDeclaration will resolve // the reference. - List referencedModelNames = new ArrayList(); + List referencedModelNames = new ArrayList<>(); getTypeString(addProps, "", "", referencedModelNames); if (referencedModelNames.size() != 0) { // Models that are referenced in the 'additionalPropertiesType' keyword @@ -1235,7 +1235,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { String itemModelName = getModelName(itemSchema); if (objExample instanceof Iterable && itemModelName == null) { // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample.toString() + closeChars; + return fullPrefix + objExample + closeChars; } Set newSeenSchemas = new HashSet<>(seenSchemas); newSeenSchemas.add(schema); @@ -1493,7 +1493,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { protected Map getModelNameToSchemaCache() { if (modelNameToSchemaCache == null) { // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap(); + Map m = new HashMap<>(); ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { m.put(toModelName(key), schema); }); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 04fea6b122d..b24d527646a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -738,7 +738,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { return "\"" + codegenProperty.example + "\""; } else { if (Boolean.TRUE.equals(codegenProperty.isEnum)) { // enum - return "\"" + String.valueOf(((List) codegenProperty.allowableValues.get("values")).get(0)) + "\""; + return "\"" + ((List) codegenProperty.allowableValues.get("values")).get(0) + "\""; } else { return "\"" + codegenProperty.name + "_example\""; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 6ca7dd832d0..265a9afc208 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -124,13 +124,13 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig { ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "i8", "i16", "i32", "i64", "u8", "u16", "u32", "u64", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index a522c48d60a..328e18387ea 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -53,7 +53,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(RustServerCodegen.class); - private HashMap modelXmlNames = new HashMap(); + private Map modelXmlNames = new HashMap(); private static final String NO_FORMAT = "%%NO_FORMAT"; @@ -160,13 +160,13 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { ) ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList( "map", "array") ); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "bool", "char", @@ -341,7 +341,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { additionalProperties.put("serverHost", url.getHost()); additionalProperties.put("serverPort", URLPathUtils.getPort(url, serverPort)); - if (packageVersion == null || "".equals(packageVersion)) { + if (packageVersion == null || packageVersion.isEmpty()) { List versionComponents = new ArrayList<>(Arrays.asList(info.getVersion().split("[.]"))); if (versionComponents.size() < 1) { versionComponents.add("1"); @@ -1087,7 +1087,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { @Override public boolean isDataTypeFile(final String dataType) { - return dataType != null && dataType.equals(typeMapping.get("File").toString()); + return dataType != null && dataType.equals(typeMapping.get("File")); } /** @@ -1176,7 +1176,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } return datatype; } else if (p instanceof FileSchema) { - return typeMapping.get("File").toString(); + return typeMapping.get("File"); } return super.getTypeDeclaration(p); @@ -1314,7 +1314,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { // If we have callbacks, add the callbacks module, otherwise remove it boolean hasCallbacks = haveCallbacks(bundle); bundle.put("hasCallbacks", hasCallbacks); - SupportingFile[] callbackFiles = new SupportingFile[]{ + SupportingFile[] callbackFiles = { new SupportingFile("client-callbacks.mustache", "src/client", "callbacks.rs"), new SupportingFile("server-callbacks.mustache", "src/server", "callbacks.rs"), new SupportingFile("example-client-server.mustache", "examples/client", "server.rs") @@ -1674,12 +1674,12 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { Process p = Runtime.getRuntime().exec(new String[]{commandPrefix, file.toString()}); int exitValue = p.waitFor(); if (exitValue != 0) { - LOGGER.error("Error running the command ({} {}). Exit code: {}", commandPrefix, file.toString(), exitValue); + LOGGER.error("Error running the command ({} {}). Exit code: {}", commandPrefix, file, exitValue); } else { - LOGGER.info("Successfully executed: {} {}", commandPrefix, file.toString()); + LOGGER.info("Successfully executed: {} {}", commandPrefix, file); } } catch (InterruptedException | IOException e) { - LOGGER.error("Error running the command ({} ()). Exception: {}", commandPrefix, file.toString(), e.getMessage()); + LOGGER.error("Error running the command ({} ()). Exception: {}", commandPrefix, file, e.getMessage()); // Restore interrupted state Thread.currentThread().interrupt(); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java index e669b229788..ea4583aec17 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java @@ -264,16 +264,17 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements @Override public CodegenParameter fromParameter(Parameter parameter, Set imports) { CodegenParameter param = super.fromParameter(parameter, imports); - // Removing unhandled types - if (!primitiveParamTypes.contains(param.dataType)) { - param.dataType = "String"; - } - if (!param.required) { - param.vendorExtensions.put("x-has-default-value", param.defaultValue != null); - // Escaping default string values - if (param.defaultValue != null && "String".equals(param.dataType)) { - param.defaultValue = String.format(Locale.ROOT, "\"%s\"", param.defaultValue); + if (primitiveParamTypes.contains(param.dataType)) { + if (!param.required) { + param.vendorExtensions.put("x-has-default-value", param.defaultValue != null); + // Escaping default string values + if (param.defaultValue != null && "String".equals(param.dataType)) { + param.defaultValue = String.format(Locale.ROOT, "\"%s\"", param.defaultValue); + } } + } else { + // Removing unhandled types + param.dataType = "String"; } return param; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java index 6194ba802a0..146ddf06ccf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java @@ -87,7 +87,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo "native") ); - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList("double", "Int", "Long", @@ -107,7 +107,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo "Map") ); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("string", "String"); typeMapping.put("boolean", "Boolean"); typeMapping.put("integer", "Int"); @@ -158,7 +158,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo supportingFiles.add(new SupportingFile("endpoint.mustache", sourceFolder, "endpoint.scala")); supportingFiles.add(new SupportingFile("errors.mustache", sourceFolder, "errors.scala")); - languageSpecificPrimitives = new HashSet( + languageSpecificPrimitives = new HashSet<>( Arrays.asList( "String", "Boolean", @@ -175,7 +175,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo instantiationTypes.put("array", "ArrayList"); instantiationTypes.put("map", "HashMap"); - importMapping = new HashMap(); + importMapping = new HashMap<>(); importMapping.put("UUID", "java.util.UUID"); importMapping.put("URI", "java.net.URI"); importMapping.put("File", "java.io.File"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java index dd0dca689fb..2a359cb0e69 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java @@ -246,7 +246,7 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code * * @param models processed models to be further processed */ - @SuppressWarnings({"unchecked"}) + @SuppressWarnings("unchecked") private void postProcessUpdateImports(final Map models) { final String prefix = modelPackage() + "."; Map enumRefs = new HashMap(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java index 8cd1e3cc0b6..4a270fcec9f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java @@ -57,7 +57,7 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg apiPackage = "org.openapitools.server.api"; modelPackage = "org.openapitools.server.model"; - defaultIncludes = new HashSet( + defaultIncludes = new HashSet<>( Arrays.asList("double", "Int", "Long", @@ -118,7 +118,7 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg supportingFiles.add(new SupportingFile("project/plugins.sbt", "project", "plugins.sbt")); supportingFiles.add(new SupportingFile("sbt", "", "sbt")); - importMapping = new HashMap(); + importMapping = new HashMap<>(); importMapping.put("UUID", "java.util.UUID"); importMapping.put("URI", "java.net.URI"); importMapping.put("File", "java.io.File"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index c0bc8e7cf42..297c458e3c2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -89,6 +89,8 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String IMPLICIT_HEADERS = "implicitHeaders"; public static final String OPENAPI_DOCKET_CONFIG = "swaggerDocketConfig"; public static final String API_FIRST = "apiFirst"; + public static final String OAS3 = "oas3"; + public static final String SPRING_CONTROLLER = "useSpringController"; public static final String HATEOAS = "hateoas"; public static final String RETURN_SUCCESS_CODE = "returnSuccessCode"; public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException"; @@ -119,6 +121,8 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean hateoas = false; protected boolean returnSuccessCode = false; protected boolean unhandledException = false; + protected boolean useSpringController = false; + protected boolean oas3 = false; public SpringCodegen() { super(); @@ -194,6 +198,8 @@ public class SpringCodegen extends AbstractJavaCodegen CliOption.newBoolean(HATEOAS, "Use Spring HATEOAS library to allow adding HATEOAS links", hateoas)); cliOptions .add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); + cliOptions.add(CliOption.newBoolean(OAS3, "Use OAS 3 Swagger annotations instead of OAS 2 annotations", oas3)); + cliOptions.add(CliOption.newBoolean(SPRING_CONTROLLER, "Annotate the generated API as a Spring Controller", useSpringController)); cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING, "Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).", unhandledException)); @@ -360,6 +366,16 @@ public class SpringCodegen extends AbstractJavaCodegen this.setHateoas(Boolean.parseBoolean(additionalProperties.get(HATEOAS).toString())); } + if (additionalProperties.containsKey(SPRING_CONTROLLER)) { + this.setUseSpringController(convertPropertyToBoolean(SPRING_CONTROLLER)); + } + writePropertyBack(SPRING_CONTROLLER, useSpringController); + + if (additionalProperties.containsKey(OAS3)) { + this.setOas3(convertPropertyToBoolean(OAS3)); + } + writePropertyBack(OAS3, oas3); + if (additionalProperties.containsKey(RETURN_SUCCESS_CODE)) { this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); } @@ -433,7 +449,7 @@ public class SpringCodegen extends AbstractJavaCodegen supportingFiles.add(new SupportingFile("homeController.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "HomeController.java")); - if (!reactive && !apiFirst) { + if (!reactive && !apiFirst && this.openapiDocketConfig) { supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "OpenAPIDocumentationConfig.java")); @@ -496,9 +512,14 @@ public class SpringCodegen extends AbstractJavaCodegen additionalProperties.put(RESPONSE_WRAPPER, "Callable"); } - if (!apiFirst && !reactive) { + // Springfox cannot be used with oas3 or apiFirst or reactive. So, write the property back after determining + // whether it should be enabled or not. + boolean useSpringFox = false; + if (!apiFirst && !reactive && !oas3) { + useSpringFox = true; additionalProperties.put("useSpringfox", true); } + writePropertyBack("useSpringfox", useSpringFox); // Some well-known Spring or Spring-Cloud response wrappers if (isNotEmpty(responseWrapper)) { @@ -554,7 +575,7 @@ public class SpringCodegen extends AbstractJavaCodegen basePath = basePath.substring(0, pos); } - if ("".equals(basePath)) { + if (basePath.isEmpty()) { basePath = "default"; } else { co.subresourceOperation = !co.path.isEmpty(); @@ -854,6 +875,14 @@ public class SpringCodegen extends AbstractJavaCodegen this.hateoas = hateoas; } + public void setUseSpringController(boolean useSpringController) { + this.useSpringController = useSpringController; + } + + public void setOas3(boolean oas3) { + this.oas3 = oas3; + } + public void setReturnSuccessCode(boolean returnSuccessCode) { this.returnSuccessCode = returnSuccessCode; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java index a3c9efaab5e..523c7de0d09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java @@ -67,7 +67,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi outputFolder = "docs"; embeddedTemplateDir = templateDir = "htmlDocs2"; - defaultIncludes = new HashSet(); + defaultIncludes = new HashSet<>(); cliOptions.add(new CliOption("appName", "short name of the application")); cliOptions.add(new CliOption("appDescription", "description of the application")); @@ -100,10 +100,10 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); supportingFiles.add(new SupportingFile("index.mustache", "", "index.html")); - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); - languageSpecificPrimitives = new HashSet(); - importMapping = new HashMap(); + languageSpecificPrimitives = new HashSet<>(); + importMapping = new HashMap<>(); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java index 3804de3160a..910528d7498 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java @@ -54,7 +54,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig outputFolder = "docs"; embeddedTemplateDir = templateDir = "htmlDocs"; - defaultIncludes = new HashSet(); + defaultIncludes = new HashSet<>(); cliOptions.add(new CliOption("appName", "short name of the application")); cliOptions.add(new CliOption("appDescription", "description of the application")); @@ -79,10 +79,10 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); supportingFiles.add(new SupportingFile("index.mustache", "", "index.html")); - reservedWords = new HashSet(); + reservedWords = new HashSet<>(); - languageSpecificPrimitives = new HashSet(); - importMapping = new HashMap(); + languageSpecificPrimitives = new HashSet<>(); + importMapping = new HashMap<>(); } /** @@ -196,7 +196,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig public String toVarName(String name) { if (reservedWords.contains(name)) { return escapeReservedWord(name); - } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character)))) { + } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character)))) { return escape(name, specialCharReplacements, Arrays.asList("_"), null); } else { return name; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index c3efed94454..0762835b4a5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -790,7 +790,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { public String toEnumValue(String value, String datatype) { // for string, array of string if ("String".equals(datatype) || "[String]".equals(datatype) || "[String:String]".equals(datatype)) { - return "\"" + String.valueOf(value) + "\""; + return "\"" + value + "\""; } else { return String.valueOf(value); } @@ -963,7 +963,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { } // only process files with swift extension if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - String command = swiftPostProcessFile + " " + file.toString(); + String command = swiftPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index df038dad832..31614ac9b65 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -735,7 +735,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // In Java, we need to be creative to get the Timestamp in Microseconds as a long. Instant instant = ((OffsetDateTime) p.getDefault()).toInstant(); long epochMicro = TimeUnit.SECONDS.toMicros(instant.getEpochSecond()) + (instant.get(ChronoField.MICRO_OF_SECOND)); - return "Date(timeIntervalSince1970: " + String.valueOf(epochMicro) + ".0 / 1_000_000)"; + return "Date(timeIntervalSince1970: " + epochMicro + ".0 / 1_000_000)"; } else if (ModelUtils.isStringSchema(p)) { return "\"" + escapeText((String) p.getDefault()) + "\""; } @@ -955,7 +955,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig public String toEnumValue(String value, String datatype) { // for string, array of string if ("String".equals(datatype) || "[String]".equals(datatype) || "[String: String]".equals(datatype)) { - return "\"" + String.valueOf(value) + "\""; + return "\"" + value + "\""; } else { return String.valueOf(value); } @@ -1115,7 +1115,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig } // only process files with swift extension if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - String command = swiftPostProcessFile + " " + file.toString(); + String command = swiftPostProcessFile + " " + file; try { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); @@ -1146,7 +1146,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig List operations = (List) objectMap.get("operation"); for (CodegenOperation operation : operations) { for (CodegenParameter cp : operation.allParams) { - cp.vendorExtensions.put("x-swift-example", constructExampleCode(cp, modelMaps, new HashSet())); + cp.vendorExtensions.put("x-swift-example", constructExampleCode(cp, modelMaps, new HashSet<>())); } } return objs; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index f2c8033a233..758f2650f5a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -55,6 +55,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String PROVIDED_IN = "providedIn"; public static final String ENFORCE_GENERIC_MODULE_WITH_PROVIDERS = "enforceGenericModuleWithProviders"; public static final String HTTP_CONTEXT_IN_OPTIONS = "httpContextInOptions"; + public static final String DELETE_ACCEPTS_BODY = "deleteAcceptsBody"; public static final String API_MODULE_PREFIX = "apiModulePrefix"; public static final String CONFIGURATION_PREFIX = "configurationPrefix"; public static final String SERVICE_SUFFIX = "serviceSuffix"; @@ -66,7 +67,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; - protected String ngVersion = "12.0.0"; + protected String ngVersion = "12.2.12"; protected String npmRepository = null; private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; @@ -237,6 +238,12 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode additionalProperties.put(HTTP_CONTEXT_IN_OPTIONS, false); } + if (ngVersion.atLeast("12.1.0")) { + additionalProperties.put(DELETE_ACCEPTS_BODY, true); + } else { + additionalProperties.put(DELETE_ACCEPTS_BODY, false); + } + additionalProperties.put(NG_VERSION, ngVersion); if (additionalProperties.containsKey(API_MODULE_PREFIX)) { @@ -570,7 +577,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode * Parse imports */ private Set parseImports(CodegenModel cm) { - Set newImports = new HashSet(); + Set newImports = new HashSet<>(); if (cm.imports.size() > 0) { for (String name : cm.imports) { if (name.indexOf(" | ") >= 0) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index 1c0cbe1af9e..d371f617718 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -146,13 +146,13 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo "Map" )); - languageGenericTypes = new HashSet(Arrays.asList( + languageGenericTypes = new HashSet<>(Arrays.asList( "Array" )); instantiationTypes.put("array", "Array"); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("Array", "Array"); typeMapping.put("array", "Array"); typeMapping.put("List", "Array"); @@ -185,7 +185,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package. If not provided, using the version from the OpenAPI specification file.").defaultValue(this.getNpmVersion())); cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); cliOptions.add(CliOption.newBoolean(SNAPSHOT, - "When setting this property to true, the version will be suffixed with -SNAPSHOT." + this.SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), + "When setting this property to true, the version will be suffixed with -SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), false)); cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase")); @@ -339,7 +339,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo * @return TypeScript return type */ private String getReturnType(List responses) { - Set returnTypes = new HashSet(); + Set returnTypes = new HashSet<>(); for (CodegenResponse response: responses) { if (response.is2xx) { if (response.dataType != null) { @@ -424,7 +424,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } protected String toTypescriptTypeName(final String name, String safePrefix) { - ArrayList exceptions = new ArrayList(Arrays.asList("\\|", " ")); + ArrayList exceptions = new ArrayList<>(Arrays.asList("\\|", " ")); String sanName = sanitizeName(name, "(?![| ])\\W", exceptions); sanName = camelize(sanName); @@ -507,7 +507,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo if (!isFirst) { b.append(" | "); } - b.append(toEnumValue(value.toString(), dataType)); + b.append(toEnumValue(value, dataType)); isFirst = false; } return b.toString(); @@ -1220,7 +1220,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo String itemModelName = getModelName(itemSchema); if (objExample instanceof Iterable && itemModelName == null) { // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample.toString() + closeChars; + return fullPrefix + objExample + closeChars; } Set newSeenSchemas = new HashSet<>(seenSchemas); newSeenSchemas.add(schema); 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 71d53818647..bc0a2808aad 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 @@ -186,8 +186,8 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege } return "id".equals(name) || "ids".equals(name) || - (name.length() >= 3 && name.substring(name.length() - 2).equals("Id")) || - (name.length() >= 4 && name.substring(name.length() - 3).equals("Ids")); + (name.length() >= 3 && name.endsWith("Id")) || + (name.length() >= 4 && name.endsWith("Ids")); } @Override @@ -488,7 +488,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege op.returnPassthrough = null; } } - } else if (this.getDetectPassthroughModelsWithSuffixAndField() != null && op.returnBaseType.length() > this.getPassthroughSuffix().length() && op.returnBaseType.substring(op.returnBaseType.length() - this.getPassthroughSuffix().length()).equals(this.getPassthroughSuffix())) { + } else if (this.getDetectPassthroughModelsWithSuffixAndField() != null && op.returnBaseType.length() > this.getPassthroughSuffix().length() && op.returnBaseType.endsWith(this.getPassthroughSuffix())) { boolean foundMatch = false; for (CodegenProperty var : cm.vars) { if (var.name.equals(this.getPassthroughField())) { @@ -635,7 +635,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege cm.returnPassthrough = null; } } - } else if (this.getDetectPassthroughModelsWithSuffixAndField() != null && cm.name.length() > this.getPassthroughSuffix().length() && cm.name.substring(cm.name.length() - this.getPassthroughSuffix().length()).equals(this.getPassthroughSuffix())) { + } else if (this.getDetectPassthroughModelsWithSuffixAndField() != null && cm.name.length() > this.getPassthroughSuffix().length() && cm.name.endsWith(this.getPassthroughSuffix())) { boolean foundMatch = false; for (CodegenProperty var : cm.vars) { if (var.name.equals(this.getPassthroughField())) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java index 771e66db0a4..524b96209a4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java @@ -387,14 +387,12 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg * Parse imports */ private Set parseImports(CodegenModel cm) { - Set newImports = new HashSet(); + Set newImports = new HashSet<>(); if (cm.imports.size() > 0) { for (String name : cm.imports) { if (name.indexOf(" | ") >= 0) { String[] parts = name.split(" \\| "); - for (String s : parts) { - newImports.add(s); - } + newImports.addAll(Arrays.asList(parts)); } else { newImports.add(name); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java index 93fefc8403a..ad8947cb3ae 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java @@ -103,7 +103,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen @Override protected void handleMethodResponse(Operation operation, Map schemas, CodegenOperation op, ApiResponse methodResponse) { - handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); + handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java index ef9178e610d..64ce72b5cf2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java @@ -42,10 +42,10 @@ import java.util.Map; public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter { final Logger LOGGER = LoggerFactory.getLogger(HandlebarsEngineAdapter.class); - private final String[] extensions = new String[]{"handlebars", "hbs"}; + private final String[] extensions = {"handlebars", "hbs"}; // We use this as a simple lookup for valid file name extensions. This adapter will inspect .mustache (built-in) and infer the relevant handlebars filename - private final String[] canCompileFromExtensions = new String[]{".handlebars",".hbs",".mustache"}; + private final String[] canCompileFromExtensions = {".handlebars",".hbs",".mustache"}; private boolean infiniteLoops = false; private boolean prettyPrint = false; @@ -92,7 +92,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter { return tmpl.apply(context); } - @SuppressWarnings({"java:S108"}) + @SuppressWarnings("java:S108") public TemplateSource findTemplate(TemplatingExecutor generator, String templateFile) { String[] possibilities = getModifiedFileLocation(templateFile); for (String file : possibilities) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java index cc7d2a8b98d..b7819988056 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java @@ -43,7 +43,7 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter { return "mustache"; } - private final String[] extensions = new String[]{"mustache"}; + private final String[] extensions = {"mustache"}; Mustache.Compiler compiler = Mustache.compiler(); /** @@ -65,7 +65,7 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter { return tmpl.execute(bundle); } - @SuppressWarnings({"java:S108"}) // catch-all is expected, and is later thrown + @SuppressWarnings("java:S108") // catch-all is expected, and is later thrown public Reader findTemplate(TemplatingExecutor generator, String name) { for (String extension : extensions) { final String templateName = name + "." + extension; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index e26bbcaa458..b5e10d5c4b6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -1073,7 +1073,7 @@ public class ModelUtils { */ public static Schema unaliasSchema(OpenAPI openAPI, Schema schema) { - return unaliasSchema(openAPI, schema, Collections.emptyMap()); + return unaliasSchema(openAPI, schema, Collections.emptyMap()); } /** @@ -1258,7 +1258,7 @@ public class ModelUtils { } else if (composed.getOneOf() != null && !composed.getOneOf().isEmpty()) { return composed.getOneOf(); } else { - return Collections.emptyList(); + return Collections.emptyList(); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java index 47a43e04bda..e77bec480e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java @@ -119,10 +119,7 @@ public class OneOfImplementorAdditionalData { } // Add oneOf-containing models properties - we need to properly set the hasMore values to make rendering correct - for (int i = 0; i < additionalProps.size(); i++) { - CodegenProperty var = additionalProps.get(i); - implcm.vars.add(var); - } + implcm.vars.addAll(additionalProps); // Add imports for (Map oneImport : additionalImports) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java index f8308a1a66c..afd23f24cd7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java @@ -153,7 +153,7 @@ public class StringUtils { m = camelizeSlashPattern.matcher(word); while (m.find()) { - word = m.replaceFirst("" + Character.toUpperCase(m.group(1).charAt(0)) + m.group(1).substring(1)/*.toUpperCase()*/); + word = m.replaceFirst(Character.toUpperCase(m.group(1).charAt(0)) + m.group(1).substring(1)/*.toUpperCase()*/); m = camelizeSlashPattern.matcher(word); } @@ -256,7 +256,7 @@ public class StringUtils { EscapedNameOptions ns = new EscapedNameOptions(name, replacementMap.keySet(), charactersToAllow, appendToReplacement); return escapedWordsCache.get(ns, wordToEscape -> { String result = name.chars().mapToObj(c -> { - String character = "" + (char) c; + String character = String.valueOf((char) c); if (charactersToAllow != null && charactersToAllow.contains(character)) { return character; } else if (replacementMap.containsKey(character)) { @@ -264,7 +264,7 @@ public class StringUtils { } else { return character; } - }).reduce( (c1, c2) -> "" + c1 + c2).orElse(null); + }).reduce( (c1, c2) -> c1 + c2).orElse(null); if (result != null) return result; throw new RuntimeException("Word '" + name + "' could not be escaped."); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java index 5ecdf65d2bd..7bdaac0d04f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java @@ -231,4 +231,12 @@ public class URLPathUtils { return null; } } + + public static boolean isRelativeUrl(List servers) { + if (servers != null && servers.size() > 0) { + final Server firstServer = servers.get(0); + return Pattern.matches("^(\\/[\\w\\d]+)+", firstServer.getUrl()); + } + return false; + } } diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index ae52b8c30b1..3a513e9c2cd 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -527,6 +527,17 @@ fail: {{classname}}_t *{{classname}}_local_var = NULL; + {{#vars}} + {{^isPrimitiveType}} + {{#isModel}} + {{^isEnum}} + // define the local variable for {{{classname}}}->{{{name}}} + {{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL; + + {{/isEnum}} + {{/isModel}} + {{/isPrimitiveType}} + {{/vars}} {{#vars}} // {{{classname}}}->{{{name}}} cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}"); @@ -614,7 +625,6 @@ fail: {{{name}}}_local_nonprim_enum = {{datatypeWithEnum}}_parseFromJSON({{{name}}}); //enum model {{/isEnum}} {{^isEnum}} - {{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL; {{^required}}if ({{{name}}}) { {{/required}} {{{name}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); //nonprimitive {{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index d7d5a175c93..3ff7ec3ebd7 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -14,10 +14,10 @@ wrapper { buildscript { repositories { maven { url "https://repo1.maven.org/maven2" } - maven { url = 'https://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url = 'https://plugins.gradle.org/m2/' } } dependencies { - classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') + classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.24.20') } } diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache index 77b72ddc7fc..00c553067c3 100644 --- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache @@ -149,6 +149,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -177,7 +184,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index f9af1a4a9bb..97b1dd6885c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -121,7 +121,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -199,7 +199,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 37d60273dee..bb3a427f266 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = '{{groupId}}' version = '{{artifactVersion}}' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -167,3 +169,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache index 18ee1211785..914e1eb1e29 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache @@ -31,6 +31,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} import javax.xml.bind.annotation.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index e43449ddc0d..93bd6bfb825 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -78,27 +78,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/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}} + public {{classname}}() { {{#parent}}{{#parcelableModel}} + super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} + }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}}{{#jackson}} + + @JsonCreator + public {{classname}}( + {{#readOnlyVars}} + {{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} {{^isReadOnly}} @@ -244,7 +239,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} -{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES)); 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 bd148d89abd..11857cbbcdd 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 @@ -190,6 +190,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -366,5 +406,6 @@ {{#hasOAuthMethods}} 8.3.1 {{/hasOAuthMethods}} + 2.17.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index 13413bd16a0..f2f269ab7cb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -18,6 +18,9 @@ import javax.json.bind.serializer.SerializationContext; import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import javax.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} {{/withXml}} {{#withXml}} @@ -56,7 +59,21 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vars}} +{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + public {{classname}}() { + } + @JsonbCreator + public {{classname}}( + {{#readOnlyVars}} + @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} /** {{#description}} @@ -101,7 +118,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM /** * Set {{name}} **/ - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache index db4fbfd9fbc..6f2436c38a3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache @@ -31,6 +31,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} import javax.xml.bind.annotation.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index 66eb1760eb7..5f0c036797c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -81,27 +81,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/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}} + public {{classname}}() { {{#parent}}{{#parcelableModel}} + super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} + }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + + {{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} {{^isReadOnly}} @@ -247,7 +242,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} -{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES)); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 26df1b2bcda..732551cec58 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -15,6 +15,7 @@ import okhttp3.internal.http.HttpMethod; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; {{#joda}} @@ -143,6 +144,8 @@ public class ApiClient { {{#-first}} /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID */ public ApiClient(String clientId) { this(clientId, null, null); @@ -150,6 +153,9 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, Map parameters) { this(clientId, null, parameters); @@ -157,6 +163,10 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, String clientSecret, Map parameters) { this(null, clientId, clientSecret, parameters); @@ -164,6 +174,11 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { init(); @@ -954,17 +969,23 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -1316,20 +1337,16 @@ public class ApiClient { * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1348,6 +1365,13 @@ public class ApiClient { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1454,14 +1478,18 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public 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); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1684,4 +1712,26 @@ public class ApiClient { return path; } {{/dynamicOperations}} + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index ba495cc72fe..525d56fa5d5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -172,7 +172,9 @@ public class {{classname}} { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache index 68d872ceff8..4bec51da938 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache @@ -12,6 +12,7 @@ import java.util.TreeMap; /** *

ApiException class.

*/ +@SuppressWarnings("serial") {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ private int code = 0; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/ApiKeyAuth.mustache new file mode 100644 index 00000000000..a0dda669a89 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/ApiKeyAuth.mustache @@ -0,0 +1,69 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Pair; + +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/okhttp-gson/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/Authentication.mustache new file mode 100644 index 00000000000..c4ad338c793 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/Authentication.mustache @@ -0,0 +1,25 @@ +{{>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 + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the 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/okhttp-gson/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache index 9cff50a7475..417a89e34cc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache @@ -3,9 +3,11 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -32,7 +34,8 @@ 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; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBearerAuth.mustache new file mode 100644 index 00000000000..c8a9fce2965 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBearerAuth.mustache @@ -0,0 +1,52 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Pair; + +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/okhttp-gson/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuth.mustache new file mode 100644 index 00000000000..34d35985718 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuth.mustache @@ -0,0 +1,31 @@ +{{>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/okhttp-gson/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 6e6562448da..137e266b5a2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -1,6 +1,7 @@ {{#hasOAuthMethods}} package {{invokerPackage}}.auth; +import {{invokerPackage}}.ApiException; import {{invokerPackage}}.Pair; import okhttp3.Interceptor; @@ -19,6 +20,7 @@ import org.apache.oltu.oauth2.common.message.types.GrantType; import java.io.IOException; import java.net.HttpURLConnection; +import java.net.URI; import java.util.Map; import java.util.List; @@ -174,7 +176,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { // Applying authorization to parameters is performed in the retryingIntercept method @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 { // No implementation necessary } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 90342173dd6..c97cb873e97 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -3,6 +3,7 @@ apply plugin: 'eclipse' {{#sourceFolder}} apply plugin: 'java' {{/sourceFolder}} +apply plugin: 'com.diffplug.spotless' group = '{{groupId}}' version = '{{artifactVersion}}' @@ -14,6 +15,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -138,3 +140,30 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 6cd8e351291..cae64378818 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -186,6 +186,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -363,5 +405,6 @@ {{/useBeanValidation}} 4.13.2 UTF-8 + 2.17.3 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 6aba57ee04d..e48370f1539 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 @@ -480,6 +480,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index 2c49fea7069..2fa35f5249a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -458,6 +458,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index 42efebb6809..0c4d165f643 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -20,6 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} import javax.xml.bind.annotation.*; @@ -35,6 +38,9 @@ import javax.json.bind.serializer.SerializationContext; import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import javax.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} {{/jsonb}} {{#parcelableModel}} import android.os.Parcelable; diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index ce4207b3040..7ca5cedeed8 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -77,27 +77,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/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}} + public {{classname}}() { {{#parent}}{{#parcelableModel}} + super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} + }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} {{^isReadOnly}} @@ -230,7 +225,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} -{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}} this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); {{/vendorExtensions.x-is-jackson-optional-nullable}} diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache index 3de4a0d8c31..408a4a759b3 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache @@ -43,7 +43,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 56722724d9c..34aa341352a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -42,7 +42,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } {{#isArray}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache index 8d78af20a17..226ef4c69a5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache @@ -88,7 +88,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM *
N.B. {{name}} is read only; client code should not call this method. {{/isReadOnly}} */ - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 1237a55ea9c..aab11b08675 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -116,7 +116,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}} this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); {{/vendorExtensions.x-is-jackson-optional-nullable}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index e55b7e95724..c77cdb6c9e2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -95,7 +95,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache index eaa4f0a0d6a..8bbfc430101 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache @@ -31,7 +31,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index f962101b988..50b1c726407 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -30,7 +30,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 52162054e2b..9d0793fe775 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -50,7 +50,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; } @JsonProperty("{{baseName}}") - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index f96ed1ee9a4..f99576d8383 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -91,7 +91,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 63cbcb0dd31..6647b5f084e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -7,7 +7,19 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} +{{#oas3}} +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +{{/oas3}} +{{^oas3}} import io.swagger.annotations.*; +{{/oas3}} {{#jdk8-no-delegate}} {{#virtualService}} import io.virtualan.annotation.ApiVirtual; @@ -20,6 +32,9 @@ import org.springframework.http.ResponseEntity; {{#useBeanValidation}} import org.springframework.validation.annotation.Validated; {{/useBeanValidation}} +{{#useSpringController}} +import org.springframework.stereotype.Controller; +{{/useSpringController}} import org.springframework.web.bind.annotation.*; {{#jdk8-no-delegate}} {{^reactive}} @@ -55,7 +70,10 @@ import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture {{#useBeanValidation}} @Validated {{/useBeanValidation}} -@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") +{{#useSpringController}} +@Controller +{{/useSpringController}} +{{#oas3}}@Tag(name = "{{{baseName}}}", description = "the {{{baseName}}} API"){{/oas3}}{{^oas3}}@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API"){{/oas3}} {{#operations}} {{#virtualService}} @VirtualService @@ -101,6 +119,10 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} + {{#oas3}} + @Operation(summary = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }, responses = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}}{{/responses}} }{{#hasAuthMethods}},security = { + {{#authMethods}}@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} } {{/hasAuthMethods}}) + {{/oas3}}{{^oas3}} @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, @@ -108,9 +130,16 @@ public interface {{classname}} { {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + {{/oas3}} {{#implicitHeaders}} + {{#oas3}} + @Parameters({ + {{/oas3}} + {{^oas3}} @ApiImplicitParams({ + {{/oas3}} {{#headerParams}} {{>implicitHeader}} {{/headerParams}} @@ -124,13 +153,13 @@ public interface {{classname}} { produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}}, consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}} ) - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}@springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { {{#delegate-method}} return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}}); } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}@springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache index 985dee6fd2d..7500b53a1bd 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}, allowableValues = "{{{.}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{#oas3}}@Parameter(name ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}} {{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{{.}}}"{{#oas3}}){{/oas3}}{{/allowableValues}}) {{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index 18dde87c988..d6bded4b731 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache index 387e4c30c86..3e5fd7ae409 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache @@ -1,5 +1,6 @@ {{#jackson}} import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index 57bd6b555f5..78df4981339 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index bfee4134765..4b10916d66d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#oas3}}@Parameter(description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 58b6e67d34c..2f75d1c0f63 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -114,11 +114,20 @@ swagger-ui 3.14.2 + {{#oas3}} + + io.swagger.core.v3 + swagger-annotations + 2.1.2 + + {{/oas3}} + {{^oas3}} io.swagger swagger-annotations 1.5.14 + {{/oas3}} com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index 1be37a65d96..ac337fecf6a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 80453821f54..1636e591836 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -44,6 +44,14 @@ {{/parentOverridden}} + {{#oas3}} + + io.swagger.core.v3 + swagger-annotations + 2.1.2 + + {{/oas3}} + {{^oas3}} io.swagger swagger-annotations @@ -51,6 +59,7 @@ ${swagger-core-version} {{/parentOverridden}} + {{/oas3}} com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 7179f1abe40..909113d7013 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -183,11 +183,20 @@ swagger-ui 3.14.2 + {{#oas3}} + + io.swagger.core.v3 + swagger-annotations + 2.1.2 + + {{/oas3}} + {{^oas3}} io.swagger swagger-annotations 1.5.14 + {{/oas3}} com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index 78c3c9ae19d..05eb15e1054 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -1,5 +1,6 @@ package {{package}}; +import java.net.URI; import java.util.Objects; {{#imports}}import {{import}}; {{/imports}} @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} +{{#jdk8}} +import java.time.OffsetDateTime; +{{/jdk8}} {{#useBeanValidation}} import javax.validation.Valid; import javax.validation.constraints.*; @@ -22,6 +26,10 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; {{/withXml}} {{/jackson}} +{{#oas3}} +import io.swagger.v3.oas.annotations.media.Schema; +{{/oas3}} + {{#withXml}} import javax.xml.bind.annotation.*; {{/withXml}} @@ -31,6 +39,8 @@ import org.springframework.hateoas.RepresentationModel; {{/hateoas}} {{/parent}} +import java.util.*; + {{#models}} {{#model}} {{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 2596e9df399..cf75bb92ede 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaRemoveDoubleQuote}}{{{value}}}{{/lambdaRemoveDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{baseName}}", description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaRemoveDoubleQuote}}{{{value}}}{{/lambdaRemoveDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 4226edb1170..f9bc2ae722a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -1,7 +1,7 @@ /** * {{description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +{{#oas3}}@Schema({{#name}}name = "{{name}}",{{/name}}{{/oas3}}{{^oas3}}@ApiModel({{/oas3}}description = "{{{.}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{>additionalModelTypeAnnotations}} public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} @@ -112,12 +112,13 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#ha {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") + {{#oas3}}@Schema({{#name}}name = "{{{name}}}", {{/name}}{{/oas3}}{{^oas3}}@ApiModelProperty({{/oas3}}{{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}{{#oas3}}defaultValue = {{/oas3}}{{^oas3}}value = {{/oas3}}"{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } - public void {{setter}}({{>nullableDataType}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{>nullableDataType}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 050d819d635..557b3ca837a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{#oas3}}){{/oas3}}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache index cbcff066b1b..f5ac4490774 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache @@ -23,7 +23,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache index cbcff066b1b..f5ac4490774 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache @@ -23,7 +23,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/bash/README.mustache b/modules/openapi-generator/src/main/resources/bash/README.mustache index e320d2f9992..73754bf6774 100644 --- a/modules/openapi-generator/src/main/resources/bash/README.mustache +++ b/modules/openapi-generator/src/main/resources/bash/README.mustache @@ -38,6 +38,9 @@ $ echo '' | {{scriptName}} --host --content-type json < # } $ echo '' | {{scriptName}} --host --content-type json key1==value1 key2=value2 key3:=23 - +# Make POST request with form data +$ {{scriptName}} --host key1:=value1 key2:=value2 key3:=23 + # Preview the cURL command without actually executing it $ {{scriptName}} --host http://: --dry-run diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index 8d18a78f13e..5ea0327e259 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -347,6 +347,29 @@ body_parameters_to_json() { fi } +############################################################################## +# +# Converts an associative array into form urlencoded string +# +############################################################################## +body_parameters_to_form_urlencoded() { + local body_form_urlencoded="-d '" + local count=0 + for key in "${!body_parameters[@]}"; do + if [[ $((count++)) -gt 0 ]]; then + body_form_urlencoded+="&" + fi + body_form_urlencoded+="${key}=${body_parameters[${key}]}" + done + body_form_urlencoded+="'" + + if [[ "${#body_parameters[@]}" -eq 0 ]]; then + echo "" + else + echo "${body_form_urlencoded}" + fi +} + ############################################################################## # # Helper method for showing error because for example echo in @@ -841,11 +864,21 @@ call_{{operationId}}() { fi {{/hasBodyParam}} {{^hasBodyParam}} +{{#hasFormParams}} + body_form_urlencoded=$(body_parameters_to_form_urlencoded) + if [[ "$print_curl" = true ]]; then + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +{{/hasFormParams}} +{{^hasFormParams}} if [[ "$print_curl" = true ]]; then echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi +{{/hasFormParams}} {{/hasBodyParam}} } diff --git a/modules/openapi-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-generator/src/main/resources/codegen/pom.mustache index a4f01d1cbbd..1815c0115a7 100644 --- a/modules/openapi-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/pom.mustache @@ -123,6 +123,6 @@ UTF-8 {{openapiGeneratorVersion}} 1.0.0 - 4.8.1 + 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache index e386ffb74c5..1cbfb6fa6af 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache @@ -12,8 +12,8 @@ #include #include #include -#include {{^hasModelImport}}#include {{/hasModelImport}} +#include #include {{#imports}}{{{import}}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache index bd20c1bdf5a..7a2a604bf31 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache @@ -14,10 +14,10 @@ #include #include #include +#include #include <{{classname}}.h> -#include {{#imports}}{{{import}}} {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index 7418caa9cdd..6bf2d10eb01 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -74,11 +74,11 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque // Getting the query params {{#queryParams}} auto {{paramName}}Query = request.query().get("{{baseName}}"); - Pistache::Optional<{{^isContainer}}{{dataType}}{{/isContainer}}{{#isArray}}std::vector<{{items.baseType}}>{{/isArray}}> {{paramName}}; - if(!{{paramName}}Query.isEmpty()){ + std::optional<{{^isContainer}}{{dataType}}{{/isContainer}}{{#isArray}}std::vector<{{items.baseType}}>{{/isArray}}> {{paramName}}; + if({{paramName}}Query.has_value()){ {{^isContainer}}{{dataType}}{{/isContainer}}{{#isArray}}std::vector<{{items.baseType}}>{{/isArray}} valueQuery_instance; - if(fromStringValue({{paramName}}Query.get(), valueQuery_instance)){ - {{paramName}} = Pistache::Some(valueQuery_instance); + if(fromStringValue({{paramName}}Query.value(), valueQuery_instance)){ + {{paramName}} = valueQuery_instance; } } {{/queryParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache index 8fc1b19b7e7..992e26fae4e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.2) project(api-server) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) {{#addExternalLibs}} include(ExternalProject) @@ -10,15 +10,16 @@ include(ExternalProject) set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) ExternalProject_Add(PISTACHE - GIT_REPOSITORY https://github.com/oktal/pistache.git - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} + GIT_REPOSITORY https://github.com/pistacheio/pistache.git + BUILD_IN_SOURCE true + INSTALL_COMMAND meson setup build --prefix=${EXTERNAL_INSTALL_LOCATION} --libdir=lib && meson install -C build ) ExternalProject_Add(NLOHMANN GIT_REPOSITORY https://github.com/nlohmann/json.git - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} - + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DJSON_BuildTests=OFF ) + include_directories(${EXTERNAL_INSTALL_LOCATION}/include) link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) {{/addExternalLibs}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache index be0ea874da8..8c152b757a0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache @@ -12,7 +12,7 @@ {{#imports}}{{{this}}} {{/imports}} #include -{{#hasOptional}}#include {{/hasOptional}} +{{#hasOptional}}#include {{/hasOptional}} namespace {{modelNamespace}} { @@ -20,7 +20,7 @@ namespace {{modelNamespace}} struct {{classname}} { {{#vars}} - {{^required}}Pistache::Optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{name}}; + {{^required}}std::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{name}}; {{/vars}} bool operator==(const {{classname}}& other) const; diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache index 987926b7c4e..f1a0c0fee31 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache @@ -45,7 +45,7 @@ void from_json(const nlohmann::json& j, {{classname}}& o) {{^required}}if (j.find("{{baseName}}") != j.end()) { {{{dataType}}} temporary_{{name}}; j.at("{{baseName}}").get_to(temporary_{{name}}); - o.{{name}} = Pistache::Some(temporary_{{name}}); + o.{{name}} = temporary_{{name}}; }{{/required}} {{/vars}} } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache index c48c32708b9..86d8cb029c3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache @@ -22,7 +22,8 @@ HEADERS += \ $${PWD}/{{prefix}}Enum.h \ $${PWD}/{{prefix}}HttpFileElement.h \ $${PWD}/{{prefix}}ServerConfiguration.h \ - $${PWD}/{{prefix}}ServerVariable.h + $${PWD}/{{prefix}}ServerVariable.h \ + $${PWD}/{{prefix}}Oauth.h SOURCES += \ # Models @@ -42,4 +43,5 @@ SOURCES += \ # Others $${PWD}/{{prefix}}Helpers.cpp \ $${PWD}/{{prefix}}HttpRequest.cpp \ - $${PWD}/{{prefix}}HttpFileElement.cpp + $${PWD}/{{prefix}}HttpFileElement.cpp \ + $${PWD}/{{prefix}}Oauth.cpp diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache index 3f7e5035d79..23ce15ffe5e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache @@ -678,8 +678,128 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} if (findChildren<{{prefix}}HttpRequestWorker*>().count() == 0) { emit allPendingRequestsCompleted(); } + });{{#authMethods}}{{#isOAuth}}{{#isCode}} + _OauthMethod = 2; + _implicitFlow.unlink(); + _credentialFlow.unlink(); + _passwordFlow.unlink(); + _authFlow.link(); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + auto token = _authFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} + _latestWorker->setResponseCompressionEnabled(isResponseCompressionEnabled); + _latestWorker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} + + connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); + connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){ + emit allPendingRequestsCompleted(); + } }); + _latestInput = input; + _latestScope = scope;{{/isCode}} + {{#isImplicit}} + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} + _latestWorker->setResponseCompressionEnabled(isResponseCompressionEnabled); + _latestWorker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} + + connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); + connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope;{{/isImplicit}} + {{#isApplication}} + _OauthMethod = 3; + _authFlow.unlink(); + _implicitFlow.unlink(); + _passwordFlow.unlink(); + _credentialFlow.link(); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + auto token = _credentialFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} + _latestWorker->setResponseCompressionEnabled(isResponseCompressionEnabled); + _latestWorker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} + + connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); + connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope;{{/isApplication}} + {{#isPassword}} + _OauthMethod = 4; + _passwordFlow.link(); + _authFlow.unlink(); + _implicitFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + auto token = _passwordFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} + _latestWorker->setResponseCompressionEnabled(isResponseCompressionEnabled); + _latestWorker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} + + connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); + connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + {{/isPassword}}{{/isOAuth}}{{/authMethods}} + worker->execute(&input); } @@ -733,7 +853,56 @@ void {{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit {{nickname}}Signal({{#returnType}}output{{/returnType}}); - emit {{nickname}}SignalFull(worker{{#returnType}}, output{{/returnType}}); + emit {{nickname}}SignalFull(worker{{#returnType}}, output{{/returnType}});{{#authMethods}}{{#isOAuth}}{{#isCode}} + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_authFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + QString scopeStr = scope.join(" "); + QString authorizationUrl("{{authorizationUrl}}"); + QString tokenUrl("{{tokenUrl}}"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _authFlow.setVariables(authorizationUrl, tokenUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId", "clientSecret"); + emit _authFlow.authenticationNeeded();{{/isCode}} + {{#isImplicit}} + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + QString scopeStr = scope.join(" "); + QString authorizationUrl("{{authorizationUrl}}"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded();{{/isImplicit}} + {{#isApplication}} + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_credentialFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + QString scopeStr = scope.join(" "); + QString tokenUrl("{{tokenUrl}}"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _credentialFlow.setVariables(tokenUrl , scopeStr, "clientId", "clientSecret"); + emit _credentialFlow.authenticationNeeded();{{/isApplication}} + {{#isPassword}} + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_passwordFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + {{#scopes}} + scope.append("{{scope}}"); + {{/scopes}} + QString scopeStr = scope.join(" "); + QString tokenUrl("{{tokenUrl}}"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _passwordFlow.setVariables(tokenUrl , scopeStr ,"clientId", "clientSecret", "username", "password"); + emit _passwordFlow.authenticationNeeded(); + {{/isPassword}}{{/isOAuth}}{{/authMethods}} } else { emit {{nickname}}SignalE({{#returnType}}output, {{/returnType}}error_type, error_str); emit {{nickname}}SignalEFull(worker, error_type, error_str); @@ -742,6 +911,55 @@ void {{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker *worker) { {{/operation}} {{/operations}} +void {{classname}}::tokenAvailable(){ + + oauthToken token; + switch (_OauthMethod) { + case 1: //implicit flow + token = _implicitFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _implicitFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 2: //authorization flow + token = _authFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _authFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 3: //client credentials flow + token = _credentialFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 4: //resource owner password flow + token = _passwordFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + default: + qDebug() << "No Oauth method set!"; + break; + } +} {{#cppNamespaceDeclarations}} } // namespace {{this}} {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache index 6823ab05ec5..6d1376d52c5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache @@ -5,6 +5,7 @@ #include "{{prefix}}Helpers.h" #include "{{prefix}}HttpRequest.h" #include "{{prefix}}ServerConfiguration.h" +#include "{{prefix}}Oauth.h" {{#imports}}{{{import}}} {{/imports}} @@ -73,6 +74,14 @@ private: QMap _defaultHeaders; bool _isResponseCompressionEnabled; bool _isRequestCompressionEnabled; + {{prefix}}HttpRequestInput _latestInput; + {{prefix}}HttpRequestWorker *_latestWorker; + QStringList _latestScope; + OauthCode _authFlow; + OauthImplicit _implicitFlow; + OauthCredentials _credentialFlow; + OauthPassword _passwordFlow; + int _OauthMethod = 0; {{#operations}}{{#operation}} void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}} @@ -88,6 +97,10 @@ signals: void abortRequestsSignal(); void allPendingRequestsCompleted(); + +public slots: + void tokenAvailable(); + }; {{#cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache new file mode 100644 index 00000000000..ebe53654851 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache @@ -0,0 +1,347 @@ +#include "{{prefix}}Oauth.h" + +namespace OpenAPI { + +/* + * Base class to perform oauth2 flows + * + */ + + +void OauthBase::onFinish(QNetworkReply *rep) +{ + //TODO emit error signal when token is wrong + QJsonDocument document = QJsonDocument::fromJson(rep->readAll()); + QJsonObject rootObj = document.object(); + QString token = rootObj.find("access_token").value().toString(); + QString scope = rootObj.find("scope").value().toString(); + QString type = rootObj.find("token_type").value().toString(); + int expiresIn = rootObj.find("expires_in").value().toInt(); + addToken(oauthToken(token, expiresIn, scope, type)); +} + +oauthToken OauthBase::getToken(QString scope) +{ + auto tokenIt = m_oauthTokenMap.find(scope); + return tokenIt != m_oauthTokenMap.end() ? tokenIt.value() : oauthToken(); +} + +void OauthBase::addToken(oauthToken token) +{ + m_oauthTokenMap.insert(token.getScope(),token); + emit tokenReceived(); + +} + +void OauthBase::removeToken(QString scope) +{ + m_oauthTokenMap.remove(scope); +} + +/* + * Class to perform the authorization code flow + * + */ + +OauthCode::OauthCode(QObject *parent) : OauthBase(parent){} + +void OauthCode::link(){ + connect(&m_server, SIGNAL(dataReceived(QMap)), this, SLOT(onVerificationReceived(QMap))); + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); + connect(this, SIGNAL(tokenReceived()), &m_server, SLOT(stop())); +} + +void OauthCode::unlink() +{ + disconnect(this,0,0,0); + disconnect(&m_server,0,0,0); +} + +void OauthCode::setVariables(QString authUrl, QString tokenUrl, QString scope, QString state, QString redirectUri, QString clientId, QString clientSecret, QString accessType){ + + m_authUrl = QUrl(authUrl); + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_accessType = accessType; + m_state = state; + m_redirectUri = redirectUri; + m_clientId = clientId; + m_clientSecret = clientSecret; + +} + +void OauthCode::authenticationNeededCallback() +{ + QDesktopServices::openUrl(QUrl(m_authUrl.toString() + "?scope=" + m_scope + (m_accessType=="" ? "" : "&access_type=" + m_accessType) + "&response_type=code" + "&state=" + m_state + "&redirect_uri=" + m_redirectUri + "&client_id=" + m_clientId)); + m_server.start(); +} + +void OauthCode::onVerificationReceived(const QMap response) { + + // Save access code + QString state(response.value("state")); + QString scope(response.value("scope")); + QString code(response.value("code")); + + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "authorization_code"); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("code", code); + postData.addQueryItem("redirect_uri", m_redirectUri); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + +/* + * Class to perform the implicit flow + * + */ + +OauthImplicit::OauthImplicit(QObject *parent) : OauthBase(parent){} + +void OauthImplicit::link() +{ + //TODO correct linking + connect(&m_server, SIGNAL(dataReceived(QMap)), this, SLOT(ImplicitTokenReceived(QMap))); + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); + connect(this, SIGNAL(tokenReceived()), &m_server, SLOT(stop())); + m_linked = true; +} + +void OauthImplicit::unlink() +{ + disconnect(this,0,0,0); + disconnect(&m_server,0,0,0); + m_linked = false; +} + +void OauthImplicit::setVariables(QString authUrl, QString scope, QString state, QString redirectUri, QString clientId, QString accessType){ + + m_authUrl = QUrl(authUrl); + m_scope = scope; + m_accessType = accessType; + m_state = state; + m_redirectUri = redirectUri; + m_clientId = clientId; + +} + +void OauthImplicit::authenticationNeededCallback() +{ + QDesktopServices::openUrl(QUrl(m_authUrl.toString() + "?scope=" + m_scope + (m_accessType=="" ? "" : "&access_type=" + m_accessType) + "&response_type=token" + "&state=" + m_state + "&redirect_uri=" + m_redirectUri + "&client_id=" + m_clientId)); + m_server.start(); +} + +void OauthImplicit::ImplicitTokenReceived(const QMap response) +{ + QString token = response.find("access_token").value(); + QString scope = response.find("scope").value(); + QString type = response.find("token_type").value(); + int expiresIn = response.find("expires_in").value().toInt(); + addToken(oauthToken(token, expiresIn, scope, type)); +} + + +/* + * Class to perform the client credentials flow + * + */ +OauthCredentials::OauthCredentials(QObject *parent) : OauthBase(parent){} +void OauthCredentials::link() +{ + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); +} + +void OauthCredentials::unlink() +{ + disconnect(this,0,0,0); +} + +void OauthCredentials::setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret){ + + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_clientId = clientId; + m_clientSecret = clientSecret; + +} + +void OauthCredentials::authenticationNeededCallback() +{ + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "client_credentials"); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("scope", m_scope); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + +/* + * Class to perform the resource owner password flow + * + */ +OauthPassword::OauthPassword(QObject *parent) : OauthBase(parent){} +void OauthPassword::link() +{ + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); +} + +void OauthPassword::unlink() +{ + disconnect(this,0,0,0); +} + +void OauthPassword::setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret, QString username, QString password){ + + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_clientId = clientId; + m_clientSecret = clientSecret; + m_username = username; + m_password = password; + +} +void OauthPassword::authenticationNeededCallback() +{ + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "password"); + postData.addQueryItem("username", m_username); + postData.addQueryItem("password", m_password); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("scope", m_scope); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + + +/* + * Class that provides a simple reply server + * + */ + +ReplyServer::ReplyServer(QObject *parent) : QTcpServer(parent) +{ + connect(this, SIGNAL(newConnection()), this, SLOT(onConnected())); + m_reply ="you can close this window now!"; +} + +void ReplyServer::start() +{ + if(!listen(QHostAddress::Any, 9999)) + { + qDebug() << "Server could not start"; + } + else + { + qDebug() << "Server started!"; + } +} + +void ReplyServer::stop() +{ + qDebug() << "Stopping the Server..."; + QTcpServer::close(); +} + +void ReplyServer::onConnected() +{ + // need to grab the socket + QTcpSocket *socket = nextPendingConnection(); + connect(socket, SIGNAL(readyRead()), this, SLOT(read()), Qt::UniqueConnection); + connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); + +} + +void ReplyServer::read() +{ + QTcpSocket *socket = qobject_cast(sender()); + if (!socket) { + qDebug() << "No socket available"; + return; + } + qDebug() << "Socket connected"; + + QTextStream os(socket); + os.setAutoDetectUnicode(true); + os << "HTTP/1.0 200 Ok\r\n" + "Content-Type: text/html; charset=\"utf-8\"\r\n" + "\r\n" + <<"\ + \ + \ + \ + \ + \ +

You can close this window now!

\ + \ + "; + + QByteArray data = socket->readLine(); + QString splitGetLine = QString(data); + splitGetLine.remove("GET"); + splitGetLine.remove("HTTP/1.1"); + splitGetLine.remove("\r\n"); + splitGetLine.remove(" "); + //prefix is needed to extract query params + QUrl getTokenUrl("http://" + splitGetLine); + QList< QPair > tokens; + + QUrlQuery query(getTokenUrl); + tokens = query.queryItems(); + + + QMap queryParams; + QPair tokenPair; + foreach (tokenPair, tokens) { + QString key = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.first.trimmed().toLatin1())); + QString value = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.second.trimmed().toLatin1())); + queryParams.insert(key, value); + } + if (!queryParams.contains("state")) { + + socket->close(); + return; + } + socket->close(); + + emit dataReceived(queryParams); +} + + +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache new file mode 100644 index 00000000000..03aa0dde901 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache @@ -0,0 +1,175 @@ +{{>licenseInfo}} +/** + * Providing a Oauth2 Class and a ReplyServer for the Oauth2 authorization code flow. + */ +#ifndef {{prefix}}_OAUTH2_H +#define {{prefix}}_OAUTH2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} + +class oauthToken +{ +public: + oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ + m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + } + oauthToken(){ + m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + } + QString getToken(){return m_token;}; + QString getScope(){return m_scope;}; + QString getType(){return m_type;}; + bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + +private: + QString m_token; + QDateTime m_validUntil; + QString m_scope; + QString m_type; +}; + +class ReplyServer : public QTcpServer +{ + Q_OBJECT +public: + explicit ReplyServer(QObject *parent = nullptr); + void setReply(QByteArray reply){m_reply = reply;}; + void run(); +private: + QByteArray m_reply; + +signals: + void dataReceived(QMap); + +public slots: + void onConnected(); + void read(); + void start(); + void stop(); +}; + +//Base class +class OauthBase : public QObject +{ + Q_OBJECT +public: + OauthBase(QObject* parent = nullptr) : QObject(parent) {}; + oauthToken getToken(QString scope); + void addToken(oauthToken token); + void removeToken(QString scope); + bool linked(){return m_linked;}; + virtual void link()=0; + virtual void unlink()=0; + +protected: + QMap m_oauthTokenMap; + QUrl m_authUrl; + QUrl m_tokenUrl; + QString m_scope, m_accessType, m_state, m_redirectUri, m_clientId, m_clientSecret; + bool m_linked; + +public slots: + virtual void authenticationNeededCallback()=0; + void onFinish(QNetworkReply *rep); + +signals: + void authenticationNeeded(); + void tokenReceived(); +}; + +// Authorization code flow +class OauthCode : public OauthBase +{ + Q_OBJECT +public: + OauthCode(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString authUrl, QString tokenUrl, QString scope, QString state, QString redirectUri, QString clientId, QString clientSecret, QString accessType = ""); + +private: + ReplyServer m_server; + +public slots: + void authenticationNeededCallback() override; + void onVerificationReceived(const QMap response); + +}; + +// Implicit flow +class OauthImplicit : public OauthBase +{ + Q_OBJECT +public: + OauthImplicit(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString authUrl, QString scope, QString state, QString redirectUri, QString clientId, QString accessType = ""); + +private: + ReplyServer m_server; + +public slots: + void authenticationNeededCallback() override; + void ImplicitTokenReceived(const QMap response); +}; + +//client credentials flow +class OauthCredentials : public OauthBase +{ + Q_OBJECT +public: + OauthCredentials(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret); + +public slots: + void authenticationNeededCallback() override; + +}; + +//resource owner password flow +class OauthPassword : public OauthBase +{ + Q_OBJECT +public: + OauthPassword(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret, QString username, QString password); + +private: + QString m_username, m_password; + +public slots: + void authenticationNeededCallback() override; + +}; + + +{{#cppNamespaceDeclarations}} +} // namespace {{this}} +{{/cppNamespaceDeclarations}} +#endif // {{prefix}}_OAUTH2_H diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/platformio.ini.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/platformio.ini.mustache index 1e364ee0ab2..9fb13516eff 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/platformio.ini.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/platformio.ini.mustache @@ -3,7 +3,7 @@ platform = espressif32 board = nodemcu-32s framework = arduino -lib_deps = https://github.com/steinwurf/bourne.git +lib_deps = https://github.com/steinwurf/bourne.git#9.0.0 extra_scripts = pre_compiling_bourne.py {{/isESP32}} @@ -12,7 +12,7 @@ extra_scripts = pre_compiling_bourne.py platform = espressif8266 board = d1_mini framework = arduino -lib_deps = https://github.com/steinwurf/bourne.git +lib_deps = https://github.com/steinwurf/bourne.git#9.0.0 build_flags = -fexceptions build_unflags = -fno-exceptions extra_scripts = pre_compiling_bourne.py diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache index 59d760f1e16..bb78f18edc6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache @@ -2,7 +2,7 @@ // Below is two examples of root certificates. // Let's encrypt root certificate -/** + "-----BEGIN CERTIFICATE-----\n" \ "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n" \ "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n" \ @@ -25,10 +25,10 @@ "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n" \ "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" \ "-----END CERTIFICATE-----\n" -*/ + // Amazon_Root_CA_1.pem -/** + "-----BEGIN CERTIFICATE-----\n" \ "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \ "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \ @@ -49,4 +49,5 @@ "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \ "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ "-----END CERTIFICATE-----\n" \ -*/ + + diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.cpp.mustache deleted file mode 100644 index 0c056c85ae3..00000000000 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.cpp.mustache +++ /dev/null @@ -1,15 +0,0 @@ -#include "AbstractService.h" -#include "Arduino.h" - -{{#isESP8266}} -void Tiny::AbstractService::begin(std::string url){ - http.begin(client, String(url.c_str())); -} -{{/isESP8266}} - - -{{#isESP32}} -void Tiny::AbstractService::begin(std::string url){ - http.begin(String(url.c_str()), test_root_ca); //HTTPS connection -} -{{/isESP32}} diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.h.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.h.mustache deleted file mode 100644 index 7dc46b5b20f..00000000000 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/AbstractService.h.mustache +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ -#define TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ -{{#isESP8266}} -#include -#include -{{/isESP8266}} - -{{#isESP32}} -#include "HTTPClient.h" -{{/isESP32}} -#include "Response.h" -namespace Tiny { - -/** -* Class -* Generated with openapi::tiny-cpp-client -*/ -class AbstractService { -public: -HTTPClient http; -{{#isESP8266}} -WiFiClient client; -{{/isESP8266}} -std::string basepath = "https://petstore3.swagger.io/api/v3"; // TODO: change to your url - -void begin(std::string url); - -{{#isESP32}} -// Go and comment out a certificate in root.cert, if you get an error here -// Certificate from file -const char* test_root_ca = -#include "../../root.cert" -; -{{/isESP32}} - -}; // end class -}// namespace Tinyclient - -#endif /* TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ */ diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.cpp.mustache new file mode 100644 index 00000000000..d164c311e70 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.cpp.mustache @@ -0,0 +1,75 @@ +#include "Service.h" +#include "Arduino.h" + +{{#isESP8266}} +void Tiny::Service::begin(std::string url){ + http.begin(client, String(url.c_str())); + + // reset params + queryParams.begin(); + formParams.begin(); +} +{{/isESP8266}} +{{#isESP32}} +void Tiny::Service::begin(std::string url){ + http.begin(String(url.c_str()), test_root_ca); //HTTPS connection + + + // reset params + queryParams.begin(); + formParams.begin(); +} +{{/isESP32}} + +void Tiny::Service::addHeader(std::string key, std::string value){ + http.addHeader(String(key.c_str()), String(value.c_str())); +} + +void Tiny::Service::addQueryParam(std::string key, std::string value){ + formParams.push_back(std::make_tuple(key, value)); +} + +void Tiny::Service::addFormParam(std::string key, std::string value){ + formParams.push_back(std::make_tuple(key, value)); +} + +int Tiny::Service::sendRequest(std::string url, const char * type, uint8_t * payload, size_t size){ + this->url = url; + prepareRequest(); + + begin(this->url); + + int httpCode = http.sendRequest(type, payload, size); + return httpCode; +} + +void Tiny::Service::prepareRequest(){ + if (!queryParams.empty()){ + this->url += "?" + encodeKeyValueTuple(this->queryParams); + } + + if (!formParams.empty()){ + this->payload = encodeKeyValueTuple(this->formParams); + } +} + +std::string Tiny::Service::encodeKeyValueTuple(std::list> params){ + std::string encoded = ""; + for (auto const& tuple : params) { + encoded += std::get<0>(tuple) + "=" + std::get<1>(tuple) + "&"; + } + + // Remove last '&' char from url + if (! encoded.empty()) + encoded.pop_back(); + + return encoded; +} + + +String Tiny::Service::getResponseBody(){ + String respBody = http.getString(); + http.end(); + return respBody; +} + diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.h.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.h.mustache new file mode 100644 index 00000000000..a2f70c1a108 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Service.h.mustache @@ -0,0 +1,54 @@ +#ifndef TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ +#define TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ +{{#isESP8266}} +#include +#include +{{/isESP8266}} + +{{#isESP32}} +#include "HTTPClient.h" +{{/isESP32}} +#include "Response.h" +#include +namespace Tiny { + +/** +* Class +* Generated with openapi::tiny-cpp-client +*/ +class Service { + public: + HTTPClient http; + {{#isESP8266}} + WiFiClient client; + {{/isESP8266}} + std::string basepath = "https://petstore3.swagger.io/api/v3"; // TODO: change to your url + std::string url = ""; + std::string payload = ""; + std::list> queryParams; + std::list> formParams; + + int sendRequest(std::string url, const char * type, uint8_t * payload, size_t size); + String getResponseBody(); + + void addQueryParam(std::string key, std::string value); + void addFormParam(std::string key, std::string value); + void addHeader(std::string key, std::string value); + + {{#isESP32}} + // Go and comment out a certificate in root.cert, if you get an error here + // Certificate from file + const char* test_root_ca = + #include "../../root.cert" + ; + {{/isESP32}} + + private: + void begin(std::string url); + void prepareRequest(); + std::string encodeKeyValueTuple(std::list> params); + +}; // end class +}// namespace Tinyclient + +#endif /* TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ */ diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache index c151d92c4d8..78e5d0bc8cf 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache @@ -40,10 +40,44 @@ using namespace Tiny; {{! Method start}} { std::string url = basepath + "{{{path}}}"; //{{#pathParams}}{{{paramName}}} {{/pathParams}} + + + // Headers | {{#headerParams}} {{paramName}} {{/headerParams}} + {{#headerParams}} + addHeader("{{baseName}}",{{paramName}}); + {{/headerParams}} + // Query | {{#queryParams}}{{paramName}} {{/queryParams}} - // Headers | {{#headerParams}}{{paramName}} {{/headerParams}} + {{#queryParams}} + {{#isArray}} + for (auto &x : {{paramName}}){ + addQueryParam("{{baseName}}", std::string(x)); + } + {{/isArray}} + {{^isArray}} + addQueryParam("{{baseName}}",{{paramName}}); + {{/isArray}} + {{/queryParams}} + // Form | {{#formParams}}{{paramName}} {{/formParams}} - // Body | {{#bodyParam}}{{paramName}}{{/bodyParam}} + {{#hasFormParams}} + addHeader("Content-Type", "application/x-www-form-urlencoded"); + {{/hasFormParams}} + {{#hasBodyParam}} + addHeader("Content-Type", "application/json"); + {{/hasBodyParam}} + + {{#formParams}} + {{#isArray}} + for (auto &x : {{paramName}}){ + addFormParam("{{baseName}}", std::string(x)); + } + {{/isArray}} + {{^isArray}} + addFormParam("{{baseName}}",{{paramName}}); + {{/isArray}} + {{/formParams}} + {{#pathParams}} std::string s_{{paramName}}("{"); @@ -56,13 +90,12 @@ using namespace Tiny; url.insert(pos, stringify({{paramName}})); {{/pathParams}} - begin(url); std::string payload = ""; // Send Request // METHOD | {{httpMethod}} + // Body | {{#bodyParam}}{{paramName}}{{/bodyParam}} {{#bodyParam}} - http.addHeader("Content-Type", "application/json"); {{#isContainer}} {{#isArray}} @@ -101,14 +134,12 @@ using namespace Tiny; {{/isContainer}} {{/bodyParam}} - int httpCode = http.sendRequest("{{httpMethod}}", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "{{httpMethod}}", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - {{#returnType}} {{#returnContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-header.mustache index 416369dcf31..35e3bc4b8f1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-header.mustache @@ -4,7 +4,7 @@ {{{defaultInclude}}} #include "Response.h" #include "Arduino.h" -#include "AbstractService.h" +#include "Service.h" #include "Helpers.h" #include @@ -20,7 +20,7 @@ namespace Tiny { * Generated with openapi::tiny-cpp-client */ -class {{classname}} : public AbstractService { +class {{classname}} : public Service { public: {{! Constructor }} {{classname}}() = default; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index fd872051c3c..03cfe1410b7 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -28,7 +28,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies {{#useRestSharp}} -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later {{/useRestSharp}} - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 237a14f92b7..86ea63f978e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -344,7 +344,14 @@ namespace {{packageName}}.{{apiPackage}} {{#formParams}} {{#required}} {{#isFile}} + {{#isArray}} + foreach (var file in {{paramName}}) { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/isArray}} + {{^isArray}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isArray}} {{/isFile}} {{^isFile}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter @@ -354,7 +361,14 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) { {{#isFile}} + {{#isArray}} + foreach (var file in {{paramName}}) { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/isArray}} + {{^isArray}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isArray}} {{/isFile}} {{^isFile}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter @@ -543,7 +557,14 @@ namespace {{packageName}}.{{apiPackage}} {{#formParams}} {{#required}} {{#isFile}} + {{#isArray}} + foreach (var file in {{paramName}}) { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/isArray}} + {{^isArray}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isArray}} {{/isFile}} {{^isFile}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter @@ -553,7 +574,14 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) { {{#isFile}} + {{#isArray}} + foreach (var file in {{paramName}}) { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/isArray}} + {{^isArray}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isArray}} {{/isFile}} {{^isFile}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 3be35749bea..cdb95110a9e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -29,12 +29,12 @@ {{/useCompareNetObjects}} - + {{#useRestSharp}} - + {{/useRestSharp}} {{#supportsRetry}} - + {{/supportsRetry}} {{#validatable}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache index 4ac44f8d347..a0afef48052 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache @@ -30,8 +30,10 @@ - - + + {{#useRestSharp}} + + {{/useRestSharp}} {{#useCompareNetObjects}} {{/useCompareNetObjects}} @@ -39,6 +41,9 @@ {{#validatable}} {{/validatable}} + {{#supportsRetry}} + + {{/supportsRetry}} diff --git a/modules/openapi-generator/src/main/resources/erlang-proper/api.mustache b/modules/openapi-generator/src/main/resources/erlang-proper/api.mustache index 30d2b92d236..2ee4b7eafa8 100644 --- a/modules/openapi-generator/src/main/resources/erlang-proper/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-proper/api.mustache @@ -18,20 +18,20 @@ Method = {{httpMethod}}, Host = application:get_env({{packageName}}, host, "http://localhost:8080"), Path = ["{{{replacedPathName}}}"], - {{#isBodyAllowed}} + {{#isMethodPutOrPatchOrPost}} Body = {{^formParams.isEmpty}}{form, [{{#formParams}}{{#required}}{{^-first}}, {{/-first}}{<<"{{{baseName}}}">>, {{paramName}}{{/required}}{{/formParams}}]++{{packageName}}_utils:optional_params([{{#formParams}}{{^required}}{{^-first}}, {{/-first}}'{{{baseName}}}'{{/required}}{{/formParams}}], _OptionalParams)}{{/formParams.isEmpty}}{{#formParams.isEmpty}}{{#bodyParams.isEmpty}}[]{{/bodyParams.isEmpty}}{{^bodyParams.isEmpty}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/bodyParams.isEmpty}}{{/formParams.isEmpty}}, ContentType = {{#hasConsumes}}hd([{{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}}]){{/hasConsumes}}{{^hasConsumes}}"text/plain"{{/hasConsumes}}, - {{/isBodyAllowed}} + {{/isMethodPutOrPatchOrPost}} {{^queryParams.isEmpty}} QueryString = [{{#queryParams}}{{^-first}}, {{/-first}}<<"{{{baseName}}}=">>, {{{paramName}}}, <<"&">>{{/queryParams}}], {{/queryParams.isEmpty}} - {{#isBodyAllowed}} + {{#isMethodPutOrPatchOrPost}} {{packageName}}_utils:request(Method, [Host, ?BASE_URL, Path{{^queryParams.isEmpty}}, <<"?">>, QueryString{{/queryParams.isEmpty}}], jsx:encode(Body), ContentType). - {{/isBodyAllowed}} - {{^isBodyAllowed}} + {{/isMethodPutOrPatchOrPost}} + {{^isMethodPutOrPatchOrPost}} {{packageName}}_utils:request(Method, [Host, ?BASE_URL, Path{{^queryParams.isEmpty}}, <<"?">>, QueryString{{/queryParams.isEmpty}}]). - {{/isBodyAllowed}} + {{/isMethodPutOrPatchOrPost}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index a9b82e3ff7d..ace6231a44f 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -316,7 +316,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache index bcf8b1f1774..e643ca051cd 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache @@ -199,7 +199,9 @@ Declare the class with extends and implements {{^isReadOnly}} {{#jackson}} {{^vendorExtensions.x-is-jackson-optional-nullable}} -{{>model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { +{{>model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#vendorExtensions.x-setter-extra-annotation}} + {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}} this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); {{/vendorExtensions.x-is-jackson-optional-nullable}} diff --git a/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache b/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache index 6099150c836..790e8635b50 100644 --- a/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache @@ -85,7 +85,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable } {{^isReadOnly}} - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } {{/isReadOnly}} diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache index abb9a7799aa..31d7d300274 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache @@ -89,7 +89,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache index a77e2b6d07d..95e66a258da 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache @@ -25,7 +25,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index be0dfa8d9c2..71d19cb2eca 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -11,6 +11,7 @@ import kotlinx.coroutines.withContext {{/useCoroutines}} {{/doNotUseRxAndCoroutines}} import {{packageName}}.infrastructure.ApiClient +import {{packageName}}.infrastructure.ApiInfrastructureResponse import {{packageName}}.infrastructure.ClientException import {{packageName}}.infrastructure.ClientError import {{packageName}}.infrastructure.ServerException @@ -27,7 +28,7 @@ import {{packageName}}.infrastructure.toMultiValue companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}") + System.getProperties().getProperty(ApiClient.baseUrlKey, "{{{basePath}}}") } } @@ -50,11 +51,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} - val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) - - val localVarResponse = request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( - localVariableConfig - ) + val localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) return{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}@withContext{{/useCoroutines}}{{/doNotUseRxAndCoroutines}} when (localVarResponse.responseType) { ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} @@ -71,6 +68,31 @@ import {{packageName}}.infrastructure.toMultiValue } } + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */{{#returnType}} + @Suppress("UNCHECKED_CAST"){{/returnType}} + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + {{#isDeprecated}} + @Deprecated(message = "This operation is deprecated.") + {{/isDeprecated}} + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{#isDeprecated}} + @Suppress("DEPRECATION") + {{/isDeprecated}} + val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + + return{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}@withContext{{/useCoroutines}}{{/doNotUseRxAndCoroutines}} request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation {{operationId}} * diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 70a44277235..57bd33d35bf 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -90,6 +90,7 @@ import com.squareup.moshi.adapter var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "{{packageName}}.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index 2d64978b0c2..3d0c640bf6a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -324,9 +324,12 @@ import okhttp3.MediaType.Companion.toMediaType } companion object { + @JvmStatic + protected val baseUrlKey = "{{packageName}}.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}") + System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}") } } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index e0a08492c53..ac4f19048a1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.10" // kotlin_version - kotlin("plugin.serialization") version "1.5.10" // kotlin_version + kotlin("multiplatform") version "1.5.31" // kotlin_version + kotlin("plugin.serialization") version "1.5.31" // kotlin_version } group = "{{groupId}}" version = "{{artifactVersion}}" -val kotlin_version = "1.5.10" -val coroutines_version = "1.5.0" -val serialization_version = "1.2.1" -val ktor_version = "1.6.0" +val kotlin_version = "1.5.31" +val coroutines_version = "1.5.2" +val serialization_version = "1.3.0" +val ktor_version = "1.6.3" repositories { mavenCentral() diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache index be6fb120855..215539ec151 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache @@ -26,6 +26,20 @@ exec-maven-plugin 1.2.1 + + bundle-clean + clean + + exec + + + /bin/bash + + gradlew + clean + + + bundle-test integration-test diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache index bf286c5e8c2..b8fd6c4c41f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache @@ -1,2 +1 @@ -enableFeaturePreview("GRADLE_METADATA") rootProject.name = "{{artifactId}}" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api_test.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api_test.mustache index ad8b33bfbff..8cca99bb5b5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api_test.mustache @@ -27,7 +27,7 @@ class {{classname}}Test { @Test fun {{operationId}}Test() {{#reactive}}= runBlockingTest {{/reactive}}{ {{#allParams}} - val {{paramName}}:{{{dataType}}}? = null + val {{paramName}}:{{>optionalDataType}} = TODO() {{/allParams}} val response: ResponseEntity<{{>returnTypes}}> = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache index f26bae849c1..826e24a4416 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{/swaggerAnnotations}} @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{paramName}}: {{>optionalDataType}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationPath}}{{/useBeanValidation}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{/swaggerAnnotations}} @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{paramName}}: {{>optionalDataType}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache index becec2257ef..c823d7a32ac 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache @@ -10,6 +10,26 @@ import kotlinx.coroutines.flow.Flow; interface {{classname}}Service { {{#operation}} + /** + * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} + {{#notes}} + * {{.}} + {{/notes}} + * + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return {{#responses}}{{message}} (status code {{code}}){{^-last}} + * or {{/-last}}{{/responses}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + * @see {{classname}}#{{operationId}} + */ {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}): {{>returnTypes}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index c4ed5beb64d..1bd2b8db9e0 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -28,6 +28,14 @@ impl ToString for {{{classname}}} { } } } + +impl Default for {{{classname}}} { + fn default() -> {{{classname}}} { + {{#allowableValues}} + Self::{{ enumVars.0.name }} + {{/allowableValues}} + } +} {{/isEnum}} {{!-- for schemas that have a discriminator --}} @@ -95,6 +103,14 @@ pub enum {{{enumName}}} { {{/enumVars}} {{/allowableValues}} } + +impl Default for {{{enumName}}} { + fn default() -> {{{enumName}}} { + {{#allowableValues}} + Self::{{ enumVars.0.name }} + {{/allowableValues}} + } +} {{/isEnum}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache index 978f5d6052f..dcca24f56d3 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache @@ -57,7 +57,10 @@ import Vapor } } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 323c21c1650..d0b300c64c1 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -56,8 +56,9 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + @discardableResult + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> URLSessionTask? { + return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -123,7 +124,7 @@ extension {{projectName}}API { {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { return Observable.create { observer -> Disposable in - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + let task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -138,7 +139,10 @@ extension {{projectName}}API { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } {{/useRxSwift}} @@ -157,8 +161,9 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { + var task: URLSessionTask? return Future<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { promise in - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -172,7 +177,11 @@ extension {{projectName}}API { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif {{/useCombine}} @@ -190,21 +199,32 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { - return try await withCheckedThrowingContinuation { continuation in - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in - switch result { - {{#returnType}} - case let .success(response): - continuation.resume(returning: response.body!) - {{/returnType}} - {{^returnType}} - case .success: - continuation.resume(returning: ()) - {{/returnType}} - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + switch result { + {{#returnType}} + case let .success(response): + continuation.resume(returning: response.body!) + {{/returnType}} + {{^returnType}} + case .success: + continuation.resume(returning: ()) + {{/returnType}} + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } {{/useAsyncAwait}} @@ -220,8 +240,9 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + @discardableResult + open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> URLSessionTask? { + return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 06d0fca6b50..31446b09543 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -78,7 +78,8 @@ private var managerStore = SynchronizedDictionary() return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: HTTPHeaders(headers)) } - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + @discardableResult + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -141,7 +142,10 @@ private var managerStore = SynchronizedDictionary() onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) + return request.task } + + return nil } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 36240f6c6c0..648556996ca 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 @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} typealias {{projectName}}APIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var taskDidReceiveChallenge: {{projectName}}APIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ private var urlSessionStore = SynchronizedDictionary() configuration. */ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ private var urlSessionStore = SynchronizedDictionary() return modifiedRequest } - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ private var urlSessionStore = SynchronizedDictionary() } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ private var urlSessionStore = SynchronizedDictionary() onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ private var urlSessionStore = SynchronizedDictionary() } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 4c5355be9ad..b7dd7cbd94b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -308,20 +308,20 @@ export class {{classname}} { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; -{{#localVarFormParams}} +{{#formParams}} {{#isFile}} // use FormData to transmit files using content-type "multipart/form-data" // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data localVarUseForm = canConsumeForm; {{/isFile}} -{{/localVarFormParams}} +{{/formParams}} if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } -{{#localVarFormParams}} +{{#formParams}} {{#isArray}} if ({{paramName}}) { {{#isCollectionFormatMulti}} @@ -345,7 +345,7 @@ export class {{classname}} { localVarFormParams = localVarFormParams.append('{{baseName}}', {{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}localVarUseForm ? new Blob([JSON.stringify({{paramName}})], {type: 'application/json'}) : {{paramName}}{{/isModel}}) as any || localVarFormParams; } {{/isArray}} -{{/localVarFormParams}} +{{/formParams}} {{/hasFormParams}} {{^isResponseFile}} @@ -355,8 +355,14 @@ export class {{classname}} { } {{/isResponseFile}} + {{#deleteAcceptsBody}} return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.configuration.basePath}{{{path}}}`,{{#isBodyAllowed}} {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} + {{/deleteAcceptsBody}} + {{^deleteAcceptsBody}} + return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.configuration.basePath}{{{path}}}`,{{#isMethodPutOrPatchOrPost}} + {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isMethodPutOrPatchOrPost}} + {{/deleteAcceptsBody}} { {{#httpContextInOptions}} context: localVarHttpContext, diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index 6744aab692a..b95a4fa6e0e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -208,8 +208,8 @@ export class {{classname}} { {{/formParams}} {{/hasFormParams}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} - {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} + return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isMethodPutOrPatchOrPost}} + {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isMethodPutOrPatchOrPost}} { {{#hasQueryParams}} params: queryParameters, 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 f1e0cd6b9b6..7afce7c4391 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 @@ -2425,7 +2425,7 @@ public class DefaultCodegenTest { Schema sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel cm = codegen.fromModel(modelName, sc); - final Set expectedMappedModels = new HashSet<>(Arrays.asList(new CodegenDiscriminator.MappedModel("UserSleep", "UserSleep"))); + final Set expectedMappedModels = Sets.newHashSet(new CodegenDiscriminator.MappedModel("UserSleep", "UserSleep")); final Set mappedModels = cm.getDiscriminator().getMappedModels(); assertEquals(mappedModels, expectedMappedModels); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index 81869d78f91..e5613d745cf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -662,6 +662,30 @@ public class DefaultGeneratorTest { Assert.assertEquals(servers.get(1).url, "http://trailingshlash.io:80/v1"); Assert.assertEquals(servers.get(2).url, "http://notrailingslash.io:80/v2"); } + + @Test + public void testHandlesRelativeUrlsInServers() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10056.yaml"); + ClientOptInput opts = new ClientOptInput(); + opts.openAPI(openAPI); + DefaultCodegen config = new DefaultCodegen(); + config.setStrictSpecBehavior(true); + opts.config(config); + final DefaultGenerator generator = new DefaultGenerator(); + generator.opts(opts); + generator.configureGeneratorProperties(); + + List files = new ArrayList<>(); + List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); + List allModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas); + List allOperations = new ArrayList<>(); + generator.generateApis(files, allOperations, allModels); + + Map bundle = generator.buildSupportFileBundle(allOperations, allModels); + LinkedList servers = (LinkedList) bundle.get("servers"); + Assert.assertEquals(servers.get(0).url, "/relative/url"); + } @Test public void testProcessUserDefinedTemplatesWithConfig() throws IOException { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index d1d5fe81dfb..e82c584a4c5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -116,12 +116,12 @@ public class TestUtils { public static void ensureContainsFile(List generatedFiles, File root, String filename) { Path path = root.toPath().resolve(filename); - assertTrue(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath().toString() + "' was not found in the list of generated files"); + assertTrue(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath() + "' was not found in the list of generated files"); } public static void ensureDoesNotContainsFile(List generatedFiles, File root, String filename) { Path path = root.toPath().resolve(filename); - assertFalse(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath().toString() + "' was found in the list of generated files"); + assertFalse(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath() + "' was found in the list of generated files"); } public static void validateJavaSourceFiles(Map fileMap) { @@ -167,7 +167,7 @@ public class TestUtils { for (String line : lines) assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]"); } catch (IOException e) { - fail("Unable to evaluate file " + path.toString()); + fail("Unable to evaluate file " + path); } } @@ -180,7 +180,7 @@ public class TestUtils { try { generatedFile = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); } catch (IOException e) { - fail("Unable to evaluate file " + path.toString()); + fail("Unable to evaluate file " + path); } String file = linearize(generatedFile); assertNotNull(file); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyBaseTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyBaseTest.java new file mode 100644 index 00000000000..7728f8f7259 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyBaseTest.java @@ -0,0 +1,56 @@ +package org.openapitools.codegen.cpptiny; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.CppTinyClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +@SuppressWarnings("rawtypes") +public class CppTinyBaseTest { + protected CppTinyClientCodegen codegen = new CppTinyClientCodegen(); + + protected CodegenModel makeCodeGenFrom(Schema model) { + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + return codegen.fromModel("sample", model); + } + + protected Schema testSchema() { + return new ObjectSchema() + .description("a sample model"); + } + + + @Test(description = "An example of testing the code model before it is rendered") + public void exampleOfATest() { + + // Make a schema object. We pretend this model comes from an OAS (openapi specification) + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject + // Then add the properties to your model. + + // Arrange + Schema schemaModel = testSchema(); + schemaModel.addProperties("id", new IntegerSchema().format("int64")); + + + // Then we generated a codemodel, with the cpp tiny code generator. + // Act + CodegenModel model_to_be_generated = makeCodeGenFrom(schemaModel); + + // We can then test, and see if the codegen model have the right data. + // Assert + CodegenProperty id_property = model_to_be_generated.vars.get(0); + Assert.assertEquals(id_property.dataType, "long"); + } + + // Make example test of assert that some codegen is generated correctly + // Assert.assertEquals(generated_code, "long id = 0;" + + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java new file mode 100644 index 00000000000..da97ae45645 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java @@ -0,0 +1,17 @@ +package org.openapitools.codegen.cpptiny; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.CppTinyClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + + + +public class CppTinyClientModelTest extends CppTinyBaseTest { + + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyServiceServiceTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyServiceServiceTest.java new file mode 100644 index 00000000000..f0cab70d635 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyServiceServiceTest.java @@ -0,0 +1,25 @@ +package org.openapitools.codegen.cpptiny; + +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.testng.Assert; +import org.testng.annotations.Test; + +@SuppressWarnings("rawtypes") +public class CppTinyServiceServiceTest extends CppTinyBaseTest { + @Test(description = "sets example value") + public void intTypeIsLong() { + // Arrange + Schema schema = testSchema(); + schema.addProperties("id", new IntegerSchema().format("int64")); + + // Act + CodegenModel model_to_be_generated = makeCodeGenFrom(schema); + + // Assert + CodegenProperty id_property = model_to_be_generated.vars.get(0); + Assert.assertEquals(id_property.dataType, "long"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java index 58ab3d67bfd..56738caef3f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java @@ -52,7 +52,7 @@ public class CSharpModelTest { } public boolean outerEnumVarsIsString(final AbstractCSharpCodegen codegen, final int openApiVersion, final Boolean nullableReferenceTypes){ - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/" + Integer.toString(openApiVersion) + "_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/" + openApiVersion + "_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); codegen.setNullableReferenceTypes(nullableReferenceTypes); codegen.setOpenAPI(openAPI); Schema schema = openAPI.getComponents().getSchemas().get("Enum_Test"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpOperationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpOperationTest.java index 175446c9a94..b0054e9a6f2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpOperationTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpOperationTest.java @@ -45,7 +45,7 @@ public class CSharpOperationTest { } public String getOperationOptionalParameterDataType(final AbstractCSharpCodegen codegen, final int openApiVersion, final Boolean nullableReferenceTypes){ - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/" + Integer.toString(openApiVersion) + "_0/petstore-with-fake-endpoints-models-for-testing.yaml"); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/" + openApiVersion + "_0/petstore-with-fake-endpoints-models-for-testing.yaml"); codegen.setNullableReferenceTypes(nullableReferenceTypes); codegen.setOpenAPI(openAPI); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java index a49ee4e825c..36b3e4edb65 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java @@ -21,6 +21,7 @@ import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -67,7 +68,7 @@ public class DartClientCodegenTest { List reservedWordsList = new ArrayList(); try { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8)); while(reader.ready()) { reservedWordsList.add(reader.readLine()); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java index 95a47ba87fe..c395fba38d4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java @@ -21,6 +21,7 @@ import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -66,7 +67,7 @@ public class DartDioClientCodegenTest { List reservedWordsList = new ArrayList(); try { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8)); while(reader.ready()) { reservedWordsList.add(reader.readLine()); } reader.close(); } catch (Exception e) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java index 898e32810b3..7166ac04044 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java @@ -26,6 +26,7 @@ import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -67,7 +68,7 @@ public class DartDioNextClientCodegenTest { List reservedWordsList = new ArrayList(); try { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8)); while(reader.ready()) { reservedWordsList.add(reader.readLine()); } reader.close(); } catch (Exception e) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java index fb822ec2df8..c53b804c852 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Arrays; -import java.lang.Exception; @SuppressWarnings("static-method") public class FSharpServerCodegenTest { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 21950902f87..ccb5ac4caf0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -568,7 +568,7 @@ public class AbstractJavaCodegenTest { Double doubleValue = 100.0; numberSchema.setDefault(doubleValue); defaultValue = codegen.toDefaultValue(numberSchema); - Assert.assertEquals(defaultValue, "new BigDecimal(\"" + doubleValue.toString() + "\")"); + Assert.assertEquals(defaultValue, "new BigDecimal(\"" + doubleValue + "\")"); // Test default value for number with format set to double numberSchema.setFormat("double"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index c9d4090b050..2e25fa70a24 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -131,7 +131,7 @@ public class JavaClientCodegenTest { CodegenParameter pathParam2 = createPathParam("pathParam2"); codegenOperation.allParams = Arrays.asList(queryParamRequired, pathParam1, pathParam2, queryParamOptional); - Map operations = ImmutableMap.of("operation", Arrays.asList(codegenOperation)); + Map operations = ImmutableMap.of("operation", Arrays.asList(codegenOperation)); Map objs = ImmutableMap.of("operations", operations, "imports", new ArrayList>()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java index 54e122aa03c..bb7fb2d9313 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java @@ -119,7 +119,7 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml"); // Check files for Single, Mixed - String[] fileS = new String[] { + String[] fileS = { "MultipartSingleApi.java", "MultipartSingleApiService.java", "MultipartSingleApiServiceImpl.java", "MultipartMixedApi.java", "MultipartMixedApiService.java", "MultipartMixedApiServiceImpl.java" }; for (String f : fileS){ @@ -127,7 +127,7 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { } // Check files for Array - final String[] fileA = new String[] { "MultipartArrayApiService.java", "MultipartArrayApi.java", "MultipartArrayApiServiceImpl.java"}; + final String[] fileA = { "MultipartArrayApiService.java", "MultipartArrayApi.java", "MultipartArrayApiServiceImpl.java"}; for (String f : fileA) { assertFileContains( files.get(f).toPath(), "List files"); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java index 16e65c34c5b..452d38f05ec 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java @@ -238,7 +238,7 @@ public class MicronautClientCodegenTest { file = linearize(generatedFile); assertNotNull(file); } catch (IOException e) { - fail("Unable to evaluate file " + path.toString()); + fail("Unable to evaluate file " + path); } return file; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 66817e5dbc7..8ba2950c2d3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -43,6 +43,7 @@ import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; public class SpringCodegenTest { @@ -722,5 +723,45 @@ public class SpringCodegenTest { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GetApi.java"), "@RequestParam(value = \"testParameter1\", required = false, defaultValue = \"BAR\")", "@RequestParam(value = \"TestParameter2\", required = false, defaultValue = \"BAR\")"); + + } + + /**define the destinationFilename*/ + private final static String DESTINATIONFILE = "OpenAPIDocumentationConfig.java"; + /**define the templateFile*/ + private final static String TEMPLATEFILE = "openapiDocumentationConfig.mustache"; + + /** + * test whether OpenAPIDocumentationConfig.java is generated + * fix issue #10287 + */ + @Test + public void testConfigFileGeneration() { + + final SpringCodegen codegen = new SpringCodegen(); + + codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, false); + codegen.additionalProperties().put(SpringCodegen.SPRING_CLOUD_LIBRARY, "spring-cloud"); + codegen.additionalProperties().put(SpringCodegen.OPENAPI_DOCKET_CONFIG, true); + codegen.additionalProperties().put(SpringCodegen.REACTIVE, false); + codegen.additionalProperties().put(SpringCodegen.API_FIRST, false); + + codegen.processOpts(); + final List supList = codegen.supportingFiles(); + String tmpFile; + String desFile; + boolean flag = false; + for (final SupportingFile s : supList) { + tmpFile = s.getTemplateFile(); + desFile = s.getDestinationFilename(); + + if (TEMPLATEFILE.equals(tmpFile)) { + flag = true; + assertEquals(desFile, DESTINATIONFILE); + } + } + if(!flag){ + fail("OpenAPIDocumentationConfig.java not generated"); + } } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java index a86cf6f1397..324775d1df2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java @@ -79,7 +79,7 @@ public class KotlinTestUtils { } else { String s; try { - s = new String(baos.toByteArray(), "UTF-8"); + s = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java index 4e7d98d2874..e59203fd50b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java @@ -43,11 +43,11 @@ public class MarkdownSampleGeneratorTest { Path expectedPath = this.outputTempDirectory.toPath().relativize(generated.toPath()); File expected = expectedFiles.resolve(expectedPath).toFile(); - Assert.assertTrue(expected.exists(), "Could not find " + expected.toString()); + Assert.assertTrue(expected.exists(), "Could not find " + expected); Assert.assertEquals(FileUtils.readFileToString(generated, StandardCharsets.UTF_8).replace("\n", "").replace("\r", ""), FileUtils.readFileToString(expected, StandardCharsets.UTF_8).replace("\n", "").replace("\r", "")); } } -} \ No newline at end of file +} 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 d82abade09f..6df13d473eb 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 @@ -163,7 +163,7 @@ public class RubyClientCodegenTest { modelMap.put("model", model); final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); + Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); Map objs = ImmutableMap.of("operations", operations, "imports", new ArrayList>()); objs = codegen.postProcessOperationsWithModels(objs, Collections.singletonList(modelMap)); CodegenOperation postProcessedOp = ((List) ((Map) objs.get("operations")).get("operation")).get(0); @@ -627,7 +627,7 @@ public class RubyClientCodegenTest { final Operation p = openAPI.getPaths().get(path).getDelete(); final CodegenOperation op = codegen.fromOperation(path, "delete", p, null); - Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); + Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); Map objs = ImmutableMap.of("operations", operations, "imports", new ArrayList>()); objs = codegen.postProcessOperationsWithModels(objs, Collections.emptyList()); CodegenOperation postProcessedOp = ((List) ((Map) objs.get("operations")).get("operation")).get(0); @@ -647,7 +647,7 @@ public class RubyClientCodegenTest { final Operation p = openAPI.getPaths().get(path).getDelete(); final CodegenOperation op = codegen.fromOperation(path, "delete", p, null); - Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); + Map operations = ImmutableMap.of("operation", Collections.singletonList(op)); Map objs = ImmutableMap.of("operations", operations, "imports", new ArrayList>()); objs = codegen.postProcessOperationsWithModels(objs, Collections.emptyList()); CodegenOperation postProcessedOp = ((List) ((Map) objs.get("operations")).get("operation")).get(0); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java index 6172b50890c..bfdb2452bdf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java @@ -141,8 +141,8 @@ public class AssertFile { if (!deltas.isEmpty()) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("files diff:\n"); - stringBuilder.append("\tfile: '").append(expected.toAbsolutePath().toString()).append("' \n"); - stringBuilder.append("\tfile: '").append(actual.toAbsolutePath().toString()).append("' \n"); + stringBuilder.append("\tfile: '").append(expected.toAbsolutePath()).append("' \n"); + stringBuilder.append("\tfile: '").append(actual.toAbsolutePath()).append("' \n"); stringBuilder.append("\tdiffs:\n"); for (Delta delta : deltas) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java index 4a5e7da18a7..7101d441b2a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java @@ -35,6 +35,7 @@ import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -206,7 +207,7 @@ public class JsonCacheTest { private void reload() throws CacheException, UnsupportedEncodingException { root.unload(); - root.load(new ByteArrayInputStream(JSON.getBytes("UTF-8"))); + root.load(new ByteArrayInputStream(JSON.getBytes(StandardCharsets.UTF_8))); } @BeforeMethod(alwaysRun = true) @@ -990,7 +991,7 @@ public class JsonCacheTest { + " \"number\": 10" // split + " }" // split + "}"; - ByteArrayInputStream in = new ByteArrayInputStream(incoming.getBytes("UTF-8")); + ByteArrayInputStream in = new ByteArrayInputStream(incoming.getBytes(StandardCharsets.UTF_8)); root.mergePolicy(MergePolicy.NO_MERGE).load(in); assertFalse(root.isDirty(), "cache should not be dirty after second load() in NO_MERGE mode"); diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_10056.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_10056.yaml new file mode 100644 index 00000000000..b33765bdf17 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_10056.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.1 +info: + title: OpenAPI Petstore + description: "sample spec" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: 1.0.0 +servers: + - url: /relative/url +tags: [] +paths: {} +components: + schemas: {} + securitySchemes: {} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 02914928aec..9a46b478206 100644 --- a/pom.xml +++ b/pom.xml @@ -176,13 +176,12 @@ ${maven-surefire-plugin.version} true - 120 + classes + 3 false none:none org.testng:testng @{argLine} -XX:+StartAttachListener - 3 - true 1000 5000 @@ -1149,7 +1148,9 @@ + samples/client/petstore/rust samples/client/petstore/rust/reqwest/petstore samples/client/petstore/rust/reqwest/petstore-async @@ -1286,6 +1287,7 @@ + samples/client/petstore/groovy samples/client/petstore/scala-akka samples/client/petstore/scala-sttp samples/client/petstore/scala-httpclient @@ -1314,9 +1316,6 @@ samples/client/petstore/java/rest-assured-jackson samples/client/petstore/java/microprofile-rest-client samples/client/petstore/java/apache-httpclient - @@ -1575,7 +1574,7 @@ 2.1.2 io.swagger.parser.v3 2.0.26 - 7.4.0 + 7.3.0 1.34 3.4.3 1.12 diff --git a/samples/client/others/csharp-netcore-complex-files/.gitignore b/samples/client/others/csharp-netcore-complex-files/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator-ignore b/samples/client/others/csharp-netcore-complex-files/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/.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/others/csharp-netcore-complex-files/.openapi-generator/FILES b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES new file mode 100644 index 00000000000..a5d0af59003 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES @@ -0,0 +1,34 @@ +.gitignore +Org.OpenAPITools.sln +README.md +appveyor.yml +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/MultipartApi.md +docs/MultipartMixedMarker.md +git_push.sh +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools/Api/MultipartApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Client/RetryConfiguration.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/InlineObject.cs +src/Org.OpenAPITools/Model/InlineObject1.cs +src/Org.OpenAPITools/Model/InlineObject2.cs +src/Org.OpenAPITools/Model/MultipartMixedMarker.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION new file mode 100644 index 00000000000..4077803655c --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/others/csharp-netcore-complex-files/Org.OpenAPITools.sln b/samples/client/others/csharp-netcore-complex-files/Org.OpenAPITools.sln new file mode 100644 index 00000000000..61278f3ea0b --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/others/csharp-netcore-complex-files/README.md b/samples/client/others/csharp-netcore-complex-files/README.md new file mode 100644 index 00000000000..7b88db28763 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/README.md @@ -0,0 +1,121 @@ +# Org.OpenAPITools - the C# library for the MultipartFile test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen + + +## Frameworks supported +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext + + +## Dependencies + +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +Install-Package CompareNETObjects +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + + +## Installation +Generate the DLL using your preferred tool (e.g. `dotnet build`) + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +``` + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MultipartApi(config); + var files = new List(); // List | Many files (optional) + + try + { + apiInstance.MultipartArray(files); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MultipartApi.MultipartArray: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*MultipartApi* | [**MultipartArray**](docs/MultipartApi.md#multipartarray) | **POST** /multipart-array | +*MultipartApi* | [**MultipartMixed**](docs/MultipartApi.md#multipartmixed) | **POST** /multipart-mixed | +*MultipartApi* | [**MultipartSingle**](docs/MultipartApi.md#multipartsingle) | **POST** /multipart-single | + + + +## Documentation for Models + + - [Model.InlineObject](docs/InlineObject.md) + - [Model.InlineObject1](docs/InlineObject1.md) + - [Model.InlineObject2](docs/InlineObject2.md) + - [Model.MultipartMixedMarker](docs/MultipartMixedMarker.md) + + + +## Documentation for Authorization + +All endpoints do not require authorization. diff --git a/samples/client/others/csharp-netcore-complex-files/appveyor.yml b/samples/client/others/csharp-netcore-complex-files/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/others/csharp-netcore-complex-files/docs/InlineObject.md b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject.md new file mode 100644 index 00000000000..6b0d642f078 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Files** | **List<System.IO.Stream>** | Many files | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/InlineObject1.md b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject1.md new file mode 100644 index 00000000000..dd54d6fa6a8 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject1.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | **System.IO.Stream** | One file | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/InlineObject2.md b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject2.md new file mode 100644 index 00000000000..ae863de9d31 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Marker** | [**MultipartMixedMarker**](MultipartMixedMarker.md) | | [optional] +**File** | **System.IO.Stream** | a file | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md new file mode 100644 index 00000000000..dbf9ae08743 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md @@ -0,0 +1,220 @@ +# Org.OpenAPITools.Api.MultipartApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**MultipartArray**](MultipartApi.md#multipartarray) | **POST** /multipart-array | +[**MultipartMixed**](MultipartApi.md#multipartmixed) | **POST** /multipart-mixed | +[**MultipartSingle**](MultipartApi.md#multipartsingle) | **POST** /multipart-single | + + + +# **MultipartArray** +> void MultipartArray (List files = null) + + + +MultipartFile array test + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class MultipartArrayExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MultipartApi(config); + var files = new List(); // List | Many files (optional) + + try + { + apiInstance.MultipartArray(files); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MultipartApi.MultipartArray: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **files** | **List<System.IO.Stream>**| Many files | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Successful operation | - | + +[[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) + + +# **MultipartMixed** +> void MultipartMixed (System.IO.Stream file, MultipartMixedMarker marker = null) + + + +Mixed MultipartFile test + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class MultipartMixedExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MultipartApi(config); + var file = BINARY_DATA_HERE; // System.IO.Stream | a file + var marker = new MultipartMixedMarker(); // MultipartMixedMarker | (optional) + + try + { + apiInstance.MultipartMixed(file, marker); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MultipartApi.MultipartMixed: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **System.IO.Stream****System.IO.Stream**| a file | + **marker** | [**MultipartMixedMarker**](MultipartMixedMarker.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Successful operation | - | + +[[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) + + +# **MultipartSingle** +> void MultipartSingle (System.IO.Stream file = null) + + + +Single MultipartFile test + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class MultipartSingleExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MultipartApi(config); + var file = BINARY_DATA_HERE; // System.IO.Stream | One file (optional) + + try + { + apiInstance.MultipartSingle(file); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MultipartApi.MultipartSingle: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **System.IO.Stream****System.IO.Stream**| One file | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedMarker.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedMarker.md new file mode 100644 index 00000000000..025eb119a4a --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedMarker.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.MultipartMixedMarker +additional object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/git_push.sh b/samples/client/others/csharp-netcore-complex-files/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Api/MultipartApiTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Api/MultipartApiTests.cs new file mode 100644 index 00000000000..f86f020a9c3 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Api/MultipartApiTests.cs @@ -0,0 +1,91 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing MultipartApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class MultipartApiTests : IDisposable + { + private MultipartApi instance; + + public MultipartApiTests() + { + instance = new MultipartApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' MultipartApi + //Assert.IsType(instance); + } + + /// + /// Test MultipartArray + /// + [Fact] + public void MultipartArrayTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List files = null; + //instance.MultipartArray(files); + } + + /// + /// Test MultipartMixed + /// + [Fact] + public void MultipartMixedTest() + { + // TODO uncomment below to test the method and replace null with proper value + //System.IO.Stream file = null; + //MultipartMixedMarker marker = null; + //instance.MultipartMixed(file, marker); + } + + /// + /// Test MultipartSingle + /// + [Fact] + public void MultipartSingleTest() + { + // TODO uncomment below to test the method and replace null with proper value + //System.IO.Stream file = null; + //instance.MultipartSingle(file); + } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject1Tests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject1Tests.cs new file mode 100644 index 00000000000..9d935ab6651 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject1Tests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineObject1 + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineObject1Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineObject1 + //private InlineObject1 instance; + + public InlineObject1Tests() + { + // TODO uncomment below to create an instance of InlineObject1 + //instance = new InlineObject1(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineObject1 + /// + [Fact] + public void InlineObject1InstanceTest() + { + // TODO uncomment below to test "IsType" InlineObject1 + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject2Tests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject2Tests.cs new file mode 100644 index 00000000000..bfcd720e7cb --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObject2Tests.cs @@ -0,0 +1,78 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineObject2 + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineObject2Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineObject2 + //private InlineObject2 instance; + + public InlineObject2Tests() + { + // TODO uncomment below to create an instance of InlineObject2 + //instance = new InlineObject2(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineObject2 + /// + [Fact] + public void InlineObject2InstanceTest() + { + // TODO uncomment below to test "IsType" InlineObject2 + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Marker' + /// + [Fact] + public void MarkerTest() + { + // TODO unit test for the property 'Marker' + } + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObjectTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObjectTests.cs new file mode 100644 index 00000000000..92ff59e7e01 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/InlineObjectTests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineObject + //private InlineObject instance; + + public InlineObjectTests() + { + // TODO uncomment below to create an instance of InlineObject + //instance = new InlineObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineObject + /// + [Fact] + public void InlineObjectInstanceTest() + { + // TODO uncomment below to test "IsType" InlineObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedMarkerTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedMarkerTests.cs new file mode 100644 index 00000000000..b1ac7cf230d --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedMarkerTests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MultipartMixedMarker + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultipartMixedMarkerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MultipartMixedMarker + //private MultipartMixedMarker instance; + + public MultipartMixedMarkerTests() + { + // TODO uncomment below to create an instance of MultipartMixedMarker + //instance = new MultipartMixedMarker(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartMixedMarker + /// + [Fact] + public void MultipartMixedMarkerInstanceTest() + { + // TODO uncomment below to test "IsType" MultipartMixedMarker + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..d58f7e14d8d --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,20 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + netcoreapp2.0 + false + + + + + + + + + + + + + diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs new file mode 100644 index 00000000000..30aaf723ab4 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs @@ -0,0 +1,646 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMultipartApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// + void MultipartArray(List files = default(List)); + + /// + /// + /// + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// ApiResponse of Object(void) + ApiResponse MultipartArrayWithHttpInfo(List files = default(List)); + /// + /// + /// + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// + void MultipartMixed(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker)); + + /// + /// + /// + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// ApiResponse of Object(void) + ApiResponse MultipartMixedWithHttpInfo(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker)); + /// + /// + /// + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// + void MultipartSingle(System.IO.Stream file = default(System.IO.Stream)); + + /// + /// + /// + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// ApiResponse of Object(void) + ApiResponse MultipartSingleWithHttpInfo(System.IO.Stream file = default(System.IO.Stream)); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMultipartApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// + /// + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task MultipartArrayAsync(List files = default(List), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> MultipartArrayWithHttpInfoAsync(List files = default(List), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task MultipartMixedAsync(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task MultipartSingleAsync(System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> MultipartSingleWithHttpInfoAsync(System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMultipartApi : IMultipartApiSync, IMultipartApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class MultipartApi : IMultipartApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public MultipartApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MultipartApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public MultipartApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public MultipartApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// + public void MultipartArray(List files = default(List)) + { + MultipartArrayWithHttpInfo(files); + } + + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse MultipartArrayWithHttpInfo(List files = default(List)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (files != null) + { + foreach (var file in files) { + localVarRequestOptions.FileParameters.Add("files", file); + } + } + + + // make the HTTP request + var localVarResponse = this.Client.Post("/multipart-array", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task MultipartArrayAsync(List files = default(List), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await MultipartArrayWithHttpInfoAsync(files, cancellationToken).ConfigureAwait(false); + } + + /// + /// MultipartFile array test + /// + /// Thrown when fails to make API call + /// Many files (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> MultipartArrayWithHttpInfoAsync(List files = default(List), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (files != null) + { + foreach (var file in files) { + localVarRequestOptions.FileParameters.Add("files", file); + } + } + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-array", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// + public void MultipartMixed(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker)) + { + MultipartMixedWithHttpInfo(file, marker); + } + + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse MultipartMixedWithHttpInfo(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker)) + { + // verify the required parameter 'file' is set + if (file == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (marker != null) + { + localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.ParameterToString(marker)); // form parameter + } + localVarRequestOptions.FileParameters.Add("file", file); + + + // make the HTTP request + var localVarResponse = this.Client.Post("/multipart-mixed", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task MultipartMixedAsync(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await MultipartMixedWithHttpInfoAsync(file, marker, cancellationToken).ConfigureAwait(false); + } + + /// + /// Mixed MultipartFile test + /// + /// Thrown when fails to make API call + /// a file + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'file' is set + if (file == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (marker != null) + { + localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.ParameterToString(marker)); // form parameter + } + localVarRequestOptions.FileParameters.Add("file", file); + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-mixed", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// + public void MultipartSingle(System.IO.Stream file = default(System.IO.Stream)) + { + MultipartSingleWithHttpInfo(file); + } + + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse MultipartSingleWithHttpInfo(System.IO.Stream file = default(System.IO.Stream)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (file != null) + { + localVarRequestOptions.FileParameters.Add("file", file); + } + + + // make the HTTP request + var localVarResponse = this.Client.Post("/multipart-single", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task MultipartSingleAsync(System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await MultipartSingleWithHttpInfoAsync(file, cancellationToken).ConfigureAwait(false); + } + + /// + /// Single MultipartFile test + /// + /// Thrown when fails to make API call + /// One file (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> MultipartSingleWithHttpInfoAsync(System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (file != null) + { + localVarRequestOptions.FileParameters.Add("file", file); + } + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-single", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs new file mode 100644 index 00000000000..11f158d6943 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -0,0 +1,867 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using RestSharp; +using RestSharp.Deserializers; +using RestSharpMethod = RestSharp.Method; +using Polly; + +namespace Org.OpenAPITools.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(IRestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(IRestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(IRestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(IRestRequest request, IRestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.GET; + break; + case HttpMethod.Post: + other = RestSharpMethod.POST; + break; + case HttpMethod.Put: + other = RestSharpMethod.PUT; + break; + case HttpMethod.Delete: + other = RestSharpMethod.DELETE; + break; + case HttpMethod.Head: + other = RestSharpMethod.HEAD; + break; + case HttpMethod.Options: + other = RestSharpMethod.OPTIONS; + break; + case HttpMethod.Patch: + other = RestSharpMethod.PATCH; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(Method(method)) + { + Resource = path, + JsonSerializer = new CustomJsonCodec(SerializerSettings, configuration) + }; + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + var bytes = ClientUtils.ReadAsBytes(fileParam.Value); + var fileStream = fileParam.Value as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + request.AddCookie(cookie.Name, cookie.Value); + } + } + + return request; + } + + private ApiResponse ToApiResponse(IRestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = client.Execute(req); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..d0cc328420a --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiResponse.cs new file mode 100644 index 00000000000..f938492a5ea --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..7544e0dfd80 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,243 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Configuration.cs new file mode 100644 index 00000000000..2bee826bd88 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Configuration.cs @@ -0,0 +1,515 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = "OpenAPI-Generator/1.0.0/csharp"; + BasePath = "http://localhost"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", ""}, + {"description", "No description provided"}, + } + } + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://localhost") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + if (index < 0 || index >= Servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {Servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = Servers[index]; + string url = (string)server["url"]; + + // go through variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + + return url; + } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat + }; + return config; + } + #endregion Static Members + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ExceptionFactory.cs new file mode 100644 index 00000000000..52de4778e2f --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs new file mode 100644 index 00000000000..c3b9ba0c212 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/HttpMethod.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/HttpMethod.cs new file mode 100644 index 00000000000..c75e09702fb --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/HttpMethod.cs @@ -0,0 +1,33 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IApiAccessor.cs new file mode 100644 index 00000000000..306708437e2 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IAsynchronousClient.cs new file mode 100644 index 00000000000..4374fd6492c --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs new file mode 100644 index 00000000000..adf0a7b2f0a --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -0,0 +1,115 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography.X509Certificates; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ISynchronousClient.cs new file mode 100644 index 00000000000..487d6ce646e --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Multimap.cs new file mode 100644 index 00000000000..76f3410b060 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 00000000000..902feea32ba --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs new file mode 100644 index 00000000000..8cbf48a6032 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -0,0 +1,74 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Dictionary FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs new file mode 100644 index 00000000000..c93633a36d9 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -0,0 +1,21 @@ +using Polly; +using RestSharp; + +namespace Org.OpenAPITools.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public class RetryConfiguration + { + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 00000000000..a280ac41985 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs new file mode 100644 index 00000000000..1fd426b347f --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs @@ -0,0 +1,119 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject + /// + [DataContract(Name = "inline_object")] + public partial class InlineObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Many files. + public InlineObject(List files = default(List)) + { + this.Files = files; + } + + /// + /// Many files + /// + /// Many files + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InlineObject {\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineObject).AreEqual; + } + + /// + /// Returns true if InlineObject instances are equal + /// + /// Instance of InlineObject to be compared + /// Boolean + public bool Equals(InlineObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Files != null) + hashCode = hashCode * 59 + this.Files.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs new file mode 100644 index 00000000000..cda1fbd4a74 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -0,0 +1,119 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject1 + /// + [DataContract(Name = "inline_object_1")] + public partial class InlineObject1 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// One file. + public InlineObject1(System.IO.Stream file = default(System.IO.Stream)) + { + this.File = file; + } + + /// + /// One file + /// + /// One file + [DataMember(Name = "file", EmitDefaultValue = false)] + public System.IO.Stream File { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InlineObject1 {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineObject1).AreEqual; + } + + /// + /// Returns true if InlineObject1 instances are equal + /// + /// Instance of InlineObject1 to be compared + /// Boolean + public bool Equals(InlineObject1 input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + hashCode = hashCode * 59 + this.File.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs new file mode 100644 index 00000000000..18d60e31ac8 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -0,0 +1,139 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject2 + /// + [DataContract(Name = "inline_object_2")] + public partial class InlineObject2 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject2() { } + /// + /// Initializes a new instance of the class. + /// + /// marker. + /// a file (required). + public InlineObject2(MultipartMixedMarker marker = default(MultipartMixedMarker), System.IO.Stream file = default(System.IO.Stream)) + { + // to ensure "file" is required (not null) + if (file == null) { + throw new ArgumentNullException("file is a required property for InlineObject2 and cannot be null"); + } + this.File = file; + this.Marker = marker; + } + + /// + /// Gets or Sets Marker + /// + [DataMember(Name = "marker", EmitDefaultValue = false)] + public MultipartMixedMarker Marker { get; set; } + + /// + /// a file + /// + /// a file + [DataMember(Name = "file", IsRequired = true, EmitDefaultValue = false)] + public System.IO.Stream File { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InlineObject2 {\n"); + sb.Append(" Marker: ").Append(Marker).Append("\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineObject2).AreEqual; + } + + /// + /// Returns true if InlineObject2 instances are equal + /// + /// Instance of InlineObject2 to be compared + /// Boolean + public bool Equals(InlineObject2 input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Marker != null) + hashCode = hashCode * 59 + this.Marker.GetHashCode(); + if (this.File != null) + hashCode = hashCode * 59 + this.File.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs new file mode 100644 index 00000000000..b10b4a7afeb --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs @@ -0,0 +1,118 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// additional object + /// + [DataContract(Name = "_multipart_mixed_marker")] + public partial class MultipartMixedMarker : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public MultipartMixedMarker(string name = default(string)) + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MultipartMixedMarker {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartMixedMarker).AreEqual; + } + + /// + /// Returns true if MultipartMixedMarker instances are equal + /// + /// Instance of MultipartMixedMarker to be compared + /// Boolean + public bool Equals(MultipartMixedMarker input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c445b1abb7c --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,31 @@ + + + + false + netstandard2.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + + + + + + + + + + + + diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index 7cce92f47b4..fe39242f70c 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0' @@ -12,6 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -121,3 +123,30 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 243592e2799..be9a75c0b54 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -179,6 +179,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -287,5 +329,6 @@ 1.3.5 4.13.2 UTF-8 + 2.17.3 diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 88b271de498..443b6003638 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -18,6 +18,7 @@ import okhttp3.internal.http.HttpMethod; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; import org.threeten.bp.LocalDate; @@ -758,17 +759,23 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -1118,20 +1125,16 @@ public class ApiClient { * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1150,6 +1153,13 @@ public class ApiClient { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1256,14 +1266,18 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public 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); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1415,4 +1429,26 @@ public class ApiClient { throw new AssertionError(e); } } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java index cf5905d28ec..46e3601c134 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java @@ -19,6 +19,7 @@ import java.util.List; /** *

ApiException class.

*/ +@SuppressWarnings("serial") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java index c32ed00a632..4c7ae244a33 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java @@ -111,6 +111,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -139,7 +146,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java index ecb3eda673d..c29f49e68a3 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java @@ -91,7 +91,9 @@ public class PingApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index fc45f354985..d41b8a58391 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -56,7 +58,8 @@ 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/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/Authentication.java index 7cc686d91d5..c7e65fb9670 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/Authentication.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -25,6 +27,10 @@ public interface Authentication { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 709e0a7a8e1..ef15ff6a57d 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -14,9 +14,11 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -43,7 +45,8 @@ 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; } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 6a454f6b418..96f57427e9f 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -46,8 +48,9 @@ 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; } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java index 1f8bb6ec2d7..99455e9f948 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java @@ -94,6 +94,8 @@ public class SomeObj { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + public SomeObj() { + } public SomeObj $type(TypeEnum $type) { diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 10c269cc2a0..43e3a3ea37d 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -38,6 +38,9 @@ $ echo '' | petstore-cli --host --content-type json ' | petstore-cli --host --content-type json key1==value1 key2=value2 key3:=23 - +# Make POST request with form data +$ petstore-cli --host key1:=value1 key2:=value2 key3:=23 + # Preview the cURL command without actually executing it $ petstore-cli --host http://: --dry-run diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index d72c7fdabe5..6810f2afa15 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -506,6 +506,29 @@ body_parameters_to_json() { fi } +############################################################################## +# +# Converts an associative array into form urlencoded string +# +############################################################################## +body_parameters_to_form_urlencoded() { + local body_form_urlencoded="-d '" + local count=0 + for key in "${!body_parameters[@]}"; do + if [[ $((count++)) -gt 0 ]]; then + body_form_urlencoded+="&" + fi + body_form_urlencoded+="${key}=${body_parameters[${key}]}" + done + body_form_urlencoded+="'" + + if [[ "${#body_parameters[@]}" -eq 0 ]]; then + echo "" + else + echo "${body_form_urlencoded}" + fi +} + ############################################################################## # # Helper method for showing error because for example echo in @@ -2286,10 +2309,11 @@ call_testEndpointParameters() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } @@ -2322,10 +2346,11 @@ call_testEnumParameters() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } @@ -2472,10 +2497,11 @@ call_testJsonFormData() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } @@ -2918,10 +2944,11 @@ call_updatePetWithForm() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } @@ -2954,10 +2981,11 @@ call_uploadFile() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } @@ -2990,10 +3018,11 @@ call_uploadFileWithRequiredFile() { if [[ -n $basic_auth_credential ]]; then basic_auth_option="-u ${basic_auth_credential}" fi + body_form_urlencoded=$(body_parameters_to_form_urlencoded) if [[ "$print_curl" = true ]]; then - echo "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + echo "curl ${body_form_urlencoded} ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" else - eval "curl -d '' ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + eval "curl ${body_form_urlencoded} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" fi } diff --git a/samples/client/petstore/bash/tests/petstore_test.sh b/samples/client/petstore/bash/tests/petstore_test.sh index 8136bc76556..682fecd35bc 100644 --- a/samples/client/petstore/bash/tests/petstore_test.sh +++ b/samples/client/petstore/bash/tests/petstore_test.sh @@ -121,3 +121,10 @@ export PETSTORE_HOST="http://petstore.swagger.io" bash $PETSTORE_CLI -ct json -ac xml addPet -" [[ "$output" =~ "37567" ]] } + +@test "updatePet with form data" { + run bash $PETSTORE_CLI --dry-run \ + updatePetWithForm petId=1 name:=lucky status:=available + [[ "$output" =~ "status=available&name=lucky" ]] + [[ "$output" =~ "/v2/pet/1" ]] +} diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 5ee8445640b..73e4f3505f8 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -168,6 +168,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ pet_t *pet_local_var = NULL; + // define the local variable for pet->category + category_t *category_local_nonprim = NULL; + // pet->id cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); if (id) { @@ -179,7 +182,6 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->category cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); - category_t *category_local_nonprim = NULL; if (category) { category_local_nonprim = category_parseFromJSON(category); //nonprimitive } diff --git a/samples/client/petstore/cpp-qt/.openapi-generator/FILES b/samples/client/petstore/cpp-qt/.openapi-generator/FILES index 3b14ec399c5..8676f752a6c 100644 --- a/samples/client/petstore/cpp-qt/.openapi-generator/FILES +++ b/samples/client/petstore/cpp-qt/.openapi-generator/FILES @@ -11,6 +11,8 @@ client/PFXHttpFileElement.cpp client/PFXHttpFileElement.h client/PFXHttpRequest.cpp client/PFXHttpRequest.h +client/PFXOauth.cpp +client/PFXOauth.h client/PFXObject.h client/PFXOrder.cpp client/PFXOrder.h diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.cpp b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp new file mode 100644 index 00000000000..a5cc0da2606 --- /dev/null +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp @@ -0,0 +1,347 @@ +#include "PFXOauth.h" + +namespace OpenAPI { + +/* + * Base class to perform oauth2 flows + * + */ + + +void OauthBase::onFinish(QNetworkReply *rep) +{ + //TODO emit error signal when token is wrong + QJsonDocument document = QJsonDocument::fromJson(rep->readAll()); + QJsonObject rootObj = document.object(); + QString token = rootObj.find("access_token").value().toString(); + QString scope = rootObj.find("scope").value().toString(); + QString type = rootObj.find("token_type").value().toString(); + int expiresIn = rootObj.find("expires_in").value().toInt(); + addToken(oauthToken(token, expiresIn, scope, type)); +} + +oauthToken OauthBase::getToken(QString scope) +{ + auto tokenIt = m_oauthTokenMap.find(scope); + return tokenIt != m_oauthTokenMap.end() ? tokenIt.value() : oauthToken(); +} + +void OauthBase::addToken(oauthToken token) +{ + m_oauthTokenMap.insert(token.getScope(),token); + emit tokenReceived(); + +} + +void OauthBase::removeToken(QString scope) +{ + m_oauthTokenMap.remove(scope); +} + +/* + * Class to perform the authorization code flow + * + */ + +OauthCode::OauthCode(QObject *parent) : OauthBase(parent){} + +void OauthCode::link(){ + connect(&m_server, SIGNAL(dataReceived(QMap)), this, SLOT(onVerificationReceived(QMap))); + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); + connect(this, SIGNAL(tokenReceived()), &m_server, SLOT(stop())); +} + +void OauthCode::unlink() +{ + disconnect(this,0,0,0); + disconnect(&m_server,0,0,0); +} + +void OauthCode::setVariables(QString authUrl, QString tokenUrl, QString scope, QString state, QString redirectUri, QString clientId, QString clientSecret, QString accessType){ + + m_authUrl = QUrl(authUrl); + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_accessType = accessType; + m_state = state; + m_redirectUri = redirectUri; + m_clientId = clientId; + m_clientSecret = clientSecret; + +} + +void OauthCode::authenticationNeededCallback() +{ + QDesktopServices::openUrl(QUrl(m_authUrl.toString() + "?scope=" + m_scope + (m_accessType=="" ? "" : "&access_type=" + m_accessType) + "&response_type=code" + "&state=" + m_state + "&redirect_uri=" + m_redirectUri + "&client_id=" + m_clientId)); + m_server.start(); +} + +void OauthCode::onVerificationReceived(const QMap response) { + + // Save access code + QString state(response.value("state")); + QString scope(response.value("scope")); + QString code(response.value("code")); + + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "authorization_code"); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("code", code); + postData.addQueryItem("redirect_uri", m_redirectUri); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + +/* + * Class to perform the implicit flow + * + */ + +OauthImplicit::OauthImplicit(QObject *parent) : OauthBase(parent){} + +void OauthImplicit::link() +{ + //TODO correct linking + connect(&m_server, SIGNAL(dataReceived(QMap)), this, SLOT(ImplicitTokenReceived(QMap))); + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); + connect(this, SIGNAL(tokenReceived()), &m_server, SLOT(stop())); + m_linked = true; +} + +void OauthImplicit::unlink() +{ + disconnect(this,0,0,0); + disconnect(&m_server,0,0,0); + m_linked = false; +} + +void OauthImplicit::setVariables(QString authUrl, QString scope, QString state, QString redirectUri, QString clientId, QString accessType){ + + m_authUrl = QUrl(authUrl); + m_scope = scope; + m_accessType = accessType; + m_state = state; + m_redirectUri = redirectUri; + m_clientId = clientId; + +} + +void OauthImplicit::authenticationNeededCallback() +{ + QDesktopServices::openUrl(QUrl(m_authUrl.toString() + "?scope=" + m_scope + (m_accessType=="" ? "" : "&access_type=" + m_accessType) + "&response_type=token" + "&state=" + m_state + "&redirect_uri=" + m_redirectUri + "&client_id=" + m_clientId)); + m_server.start(); +} + +void OauthImplicit::ImplicitTokenReceived(const QMap response) +{ + QString token = response.find("access_token").value(); + QString scope = response.find("scope").value(); + QString type = response.find("token_type").value(); + int expiresIn = response.find("expires_in").value().toInt(); + addToken(oauthToken(token, expiresIn, scope, type)); +} + + +/* + * Class to perform the client credentials flow + * + */ +OauthCredentials::OauthCredentials(QObject *parent) : OauthBase(parent){} +void OauthCredentials::link() +{ + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); +} + +void OauthCredentials::unlink() +{ + disconnect(this,0,0,0); +} + +void OauthCredentials::setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret){ + + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_clientId = clientId; + m_clientSecret = clientSecret; + +} + +void OauthCredentials::authenticationNeededCallback() +{ + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "client_credentials"); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("scope", m_scope); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + +/* + * Class to perform the resource owner password flow + * + */ +OauthPassword::OauthPassword(QObject *parent) : OauthBase(parent){} +void OauthPassword::link() +{ + connect(this, SIGNAL(authenticationNeeded()), this, SLOT(authenticationNeededCallback())); +} + +void OauthPassword::unlink() +{ + disconnect(this,0,0,0); +} + +void OauthPassword::setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret, QString username, QString password){ + + m_tokenUrl = QUrl(tokenUrl); + m_scope = scope; + m_clientId = clientId; + m_clientSecret = clientSecret; + m_username = username; + m_password = password; + +} +void OauthPassword::authenticationNeededCallback() +{ + //create query with the required fields + QUrlQuery postData; + postData.addQueryItem("grant_type", "password"); + postData.addQueryItem("username", m_username); + postData.addQueryItem("password", m_password); + postData.addQueryItem("client_id", m_clientId); + postData.addQueryItem("client_secret", m_clientSecret); + postData.addQueryItem("scope", m_scope); + QNetworkAccessManager * manager = new QNetworkAccessManager(this); + + QNetworkRequest request(m_tokenUrl); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onFinish(QNetworkReply *))); + + manager->post(request, postData.query().toUtf8()); +} + + +/* + * Class that provides a simple reply server + * + */ + +ReplyServer::ReplyServer(QObject *parent) : QTcpServer(parent) +{ + connect(this, SIGNAL(newConnection()), this, SLOT(onConnected())); + m_reply ="you can close this window now!"; +} + +void ReplyServer::start() +{ + if(!listen(QHostAddress::Any, 9999)) + { + qDebug() << "Server could not start"; + } + else + { + qDebug() << "Server started!"; + } +} + +void ReplyServer::stop() +{ + qDebug() << "Stopping the Server..."; + QTcpServer::close(); +} + +void ReplyServer::onConnected() +{ + // need to grab the socket + QTcpSocket *socket = nextPendingConnection(); + connect(socket, SIGNAL(readyRead()), this, SLOT(read()), Qt::UniqueConnection); + connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); + +} + +void ReplyServer::read() +{ + QTcpSocket *socket = qobject_cast(sender()); + if (!socket) { + qDebug() << "No socket available"; + return; + } + qDebug() << "Socket connected"; + + QTextStream os(socket); + os.setAutoDetectUnicode(true); + os << "HTTP/1.0 200 Ok\r\n" + "Content-Type: text/html; charset=\"utf-8\"\r\n" + "\r\n" + <<"\ + \ + \ + \ + \ + \ +

You can close this window now!

\ + \ + "; + + QByteArray data = socket->readLine(); + QString splitGetLine = QString(data); + splitGetLine.remove("GET"); + splitGetLine.remove("HTTP/1.1"); + splitGetLine.remove("\r\n"); + splitGetLine.remove(" "); + //prefix is needed to extract query params + QUrl getTokenUrl("http://" + splitGetLine); + QList< QPair > tokens; + + QUrlQuery query(getTokenUrl); + tokens = query.queryItems(); + + + QMap queryParams; + QPair tokenPair; + foreach (tokenPair, tokens) { + QString key = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.first.trimmed().toLatin1())); + QString value = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.second.trimmed().toLatin1())); + queryParams.insert(key, value); + } + if (!queryParams.contains("state")) { + + socket->close(); + return; + } + socket->close(); + + emit dataReceived(queryParams); +} + + +} \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.h b/samples/client/petstore/cpp-qt/client/PFXOauth.h new file mode 100644 index 00000000000..f86a29e944f --- /dev/null +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.h @@ -0,0 +1,181 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Providing a Oauth2 Class and a ReplyServer for the Oauth2 authorization code flow. + */ +#ifndef PFX_OAUTH2_H +#define PFX_OAUTH2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +namespace test_namespace { + +class oauthToken +{ +public: + oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ + m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + } + oauthToken(){ + m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + } + QString getToken(){return m_token;}; + QString getScope(){return m_scope;}; + QString getType(){return m_type;}; + bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + +private: + QString m_token; + QDateTime m_validUntil; + QString m_scope; + QString m_type; +}; + +class ReplyServer : public QTcpServer +{ + Q_OBJECT +public: + explicit ReplyServer(QObject *parent = nullptr); + void setReply(QByteArray reply){m_reply = reply;}; + void run(); +private: + QByteArray m_reply; + +signals: + void dataReceived(QMap); + +public slots: + void onConnected(); + void read(); + void start(); + void stop(); +}; + +//Base class +class OauthBase : public QObject +{ + Q_OBJECT +public: + OauthBase(QObject* parent = nullptr) : QObject(parent) {}; + oauthToken getToken(QString scope); + void addToken(oauthToken token); + void removeToken(QString scope); + bool linked(){return m_linked;}; + virtual void link()=0; + virtual void unlink()=0; + +protected: + QMap m_oauthTokenMap; + QUrl m_authUrl; + QUrl m_tokenUrl; + QString m_scope, m_accessType, m_state, m_redirectUri, m_clientId, m_clientSecret; + bool m_linked; + +public slots: + virtual void authenticationNeededCallback()=0; + void onFinish(QNetworkReply *rep); + +signals: + void authenticationNeeded(); + void tokenReceived(); +}; + +// Authorization code flow +class OauthCode : public OauthBase +{ + Q_OBJECT +public: + OauthCode(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString authUrl, QString tokenUrl, QString scope, QString state, QString redirectUri, QString clientId, QString clientSecret, QString accessType = ""); + +private: + ReplyServer m_server; + +public slots: + void authenticationNeededCallback() override; + void onVerificationReceived(const QMap response); + +}; + +// Implicit flow +class OauthImplicit : public OauthBase +{ + Q_OBJECT +public: + OauthImplicit(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString authUrl, QString scope, QString state, QString redirectUri, QString clientId, QString accessType = ""); + +private: + ReplyServer m_server; + +public slots: + void authenticationNeededCallback() override; + void ImplicitTokenReceived(const QMap response); +}; + +//client credentials flow +class OauthCredentials : public OauthBase +{ + Q_OBJECT +public: + OauthCredentials(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret); + +public slots: + void authenticationNeededCallback() override; + +}; + +//resource owner password flow +class OauthPassword : public OauthBase +{ + Q_OBJECT +public: + OauthPassword(QObject *parent = nullptr); + void link() override; + void unlink() override; + void setVariables(QString tokenUrl, QString scope, QString clientId, QString clientSecret, QString username, QString password); + +private: + QString m_username, m_password; + +public slots: + void authenticationNeededCallback() override; + +}; + + +} // namespace test_namespace +#endif // PFX_OAUTH2_H diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp index 7c999d98687..781e192159f 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp @@ -256,6 +256,34 @@ void PFXPetApi::addPet(const PFXPet &body) { emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -272,6 +300,18 @@ void PFXPetApi::addPetCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit addPetSignal(); emit addPetSignalFull(worker); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit addPetSignalE(error_type, error_str); emit addPetSignalEFull(worker, error_type, error_str); @@ -324,6 +364,34 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -340,6 +408,18 @@ void PFXPetApi::deletePetCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit deletePetSignal(); emit deletePetSignalFull(worker); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit deletePetSignalE(error_type, error_str); emit deletePetSignalEFull(worker, error_type, error_str); @@ -458,6 +538,34 @@ void PFXPetApi::findPetsByStatus(const QList &status) { emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -484,6 +592,18 @@ void PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit findPetsByStatusSignal(output); emit findPetsByStatusSignalFull(worker, output); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit findPetsByStatusSignalE(output, error_type, error_str); emit findPetsByStatusSignalEFull(worker, error_type, error_str); @@ -602,6 +722,34 @@ void PFXPetApi::findPetsByTags(const QList &tags) { emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -628,6 +776,18 @@ void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit findPetsByTagsSignal(output); emit findPetsByTagsSignalFull(worker, output); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit findPetsByTagsSignalE(output, error_type, error_str); emit findPetsByTagsSignalEFull(worker, error_type, error_str); @@ -731,6 +891,34 @@ void PFXPetApi::updatePet(const PFXPet &body) { emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -747,6 +935,18 @@ void PFXPetApi::updatePetCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit updatePetSignal(); emit updatePetSignalFull(worker); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit updatePetSignalE(error_type, error_str); emit updatePetSignalEFull(worker, error_type, error_str); @@ -801,6 +1001,34 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -817,6 +1045,18 @@ void PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit updatePetWithFormSignal(); emit updatePetWithFormSignalFull(worker); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit updatePetWithFormSignalE(error_type, error_str); emit updatePetWithFormSignalEFull(worker, error_type, error_str); @@ -871,6 +1111,34 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona emit allPendingRequestsCompleted(); } }); + _OauthMethod = 1; + _implicitFlow.link(); + _passwordFlow.unlink(); + _authFlow.unlink(); + _credentialFlow.unlink(); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + auto token = _implicitFlow.getToken(scope.join(" ")); + if(token.isValid()) + input.headers.insert("Authorization", "Bearer " + token.getToken()); + + _latestWorker = new PFXHttpRequestWorker(this, _manager); + _latestWorker->setTimeOut(_timeOut); + _latestWorker->setWorkingDirectory(_workingDirectory); + + connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback); + connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater); + connect(_latestWorker, &QObject::destroyed, [this](){ + if(findChildren().count() == 0){ + emit allPendingRequestsCompleted(); + } + }); + + _latestInput = input; + _latestScope = scope; + + worker->execute(&input); } @@ -888,10 +1156,71 @@ void PFXPetApi::uploadFileCallback(PFXHttpRequestWorker *worker) { if (worker->error_type == QNetworkReply::NoError) { emit uploadFileSignal(output); emit uploadFileSignalFull(worker, output); + } else if(worker->error_type == QNetworkReply::AuthenticationRequiredError){ + connect(&_implicitFlow, SIGNAL(tokenReceived()), this, SLOT(tokenAvailable())); + QStringList scope; + scope.append("write:pets"); + scope.append("read:pets"); + QString scopeStr = scope.join(" "); + QString authorizationUrl("http://petstore.swagger.io/api/oauth/dialog"); + //TODO get clientID and Secret and state in the config? https://swagger.io/docs/specification/authentication/oauth2/ states that you should do as you like + _implicitFlow.setVariables(authorizationUrl, scopeStr, "state" , "http://127.0.0.1:9999", "clientId"); + emit _implicitFlow.authenticationNeeded(); + + } else { emit uploadFileSignalE(output, error_type, error_str); emit uploadFileSignalEFull(worker, error_type, error_str); } } +void PFXPetApi::tokenAvailable(){ + + oauthToken token; + switch (_OauthMethod) { + case 1: //implicit flow + token = _implicitFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _implicitFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 2: //authorization flow + token = _authFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _authFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 3: //client credentials flow + token = _credentialFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 4: //resource owner password flow + token = _passwordFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + default: + qDebug() << "No Oauth method set!"; + break; + } +} } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.h b/samples/client/petstore/cpp-qt/client/PFXPetApi.h index 4007bd2e942..9fc00dd6d3c 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.h @@ -15,6 +15,7 @@ #include "PFXHelpers.h" #include "PFXHttpRequest.h" #include "PFXServerConfiguration.h" +#include "PFXOauth.h" #include "PFXApiResponse.h" #include "PFXHttpFileElement.h" @@ -116,6 +117,14 @@ private: QMap _defaultHeaders; bool _isResponseCompressionEnabled; bool _isRequestCompressionEnabled; + PFXHttpRequestInput _latestInput; + PFXHttpRequestWorker *_latestWorker; + QStringList _latestScope; + OauthCode _authFlow; + OauthImplicit _implicitFlow; + OauthCredentials _credentialFlow; + OauthPassword _passwordFlow; + int _OauthMethod = 0; void addPetCallback(PFXHttpRequestWorker *worker); void deletePetCallback(PFXHttpRequestWorker *worker); @@ -166,6 +175,10 @@ signals: void abortRequestsSignal(); void allPendingRequestsCompleted(); + +public slots: + void tokenAvailable(); + }; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp index 9ff025b0ad1..6090921ce42 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp @@ -458,4 +458,53 @@ void PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker *worker) { } } +void PFXStoreApi::tokenAvailable(){ + + oauthToken token; + switch (_OauthMethod) { + case 1: //implicit flow + token = _implicitFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _implicitFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 2: //authorization flow + token = _authFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _authFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 3: //client credentials flow + token = _credentialFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 4: //resource owner password flow + token = _passwordFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + default: + qDebug() << "No Oauth method set!"; + break; + } +} } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h index a31a6e3a74e..037ef2f4d2f 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h @@ -15,6 +15,7 @@ #include "PFXHelpers.h" #include "PFXHttpRequest.h" #include "PFXServerConfiguration.h" +#include "PFXOauth.h" #include "PFXOrder.h" #include @@ -88,6 +89,14 @@ private: QMap _defaultHeaders; bool _isResponseCompressionEnabled; bool _isRequestCompressionEnabled; + PFXHttpRequestInput _latestInput; + PFXHttpRequestWorker *_latestWorker; + QStringList _latestScope; + OauthCode _authFlow; + OauthImplicit _implicitFlow; + OauthCredentials _credentialFlow; + OauthPassword _passwordFlow; + int _OauthMethod = 0; void deleteOrderCallback(PFXHttpRequestWorker *worker); void getInventoryCallback(PFXHttpRequestWorker *worker); @@ -118,6 +127,10 @@ signals: void abortRequestsSignal(); void allPendingRequestsCompleted(); + +public slots: + void tokenAvailable(); + }; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp index b2f4d4ff96d..0d206a0f837 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp @@ -702,4 +702,53 @@ void PFXUserApi::updateUserCallback(PFXHttpRequestWorker *worker) { } } +void PFXUserApi::tokenAvailable(){ + + oauthToken token; + switch (_OauthMethod) { + case 1: //implicit flow + token = _implicitFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _implicitFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 2: //authorization flow + token = _authFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _authFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 3: //client credentials flow + token = _credentialFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + case 4: //resource owner password flow + token = _passwordFlow.getToken(_latestScope.join(" ")); + if(token.isValid()){ + _latestInput.headers.insert("Authorization", "Bearer " + token.getToken()); + _latestWorker->execute(&_latestInput); + }else{ + _credentialFlow.removeToken(_latestScope.join(" ")); + qDebug() << "Could not retreive a valid token"; + } + break; + default: + qDebug() << "No Oauth method set!"; + break; + } +} } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.h b/samples/client/petstore/cpp-qt/client/PFXUserApi.h index b216ec3fff3..0fc9a73266e 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.h @@ -15,6 +15,7 @@ #include "PFXHelpers.h" #include "PFXHttpRequest.h" #include "PFXServerConfiguration.h" +#include "PFXOauth.h" #include "PFXUser.h" #include @@ -110,6 +111,14 @@ private: QMap _defaultHeaders; bool _isResponseCompressionEnabled; bool _isRequestCompressionEnabled; + PFXHttpRequestInput _latestInput; + PFXHttpRequestWorker *_latestWorker; + QStringList _latestScope; + OauthCode _authFlow; + OauthImplicit _implicitFlow; + OauthCredentials _credentialFlow; + OauthPassword _passwordFlow; + int _OauthMethod = 0; void createUserCallback(PFXHttpRequestWorker *worker); void createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker); @@ -160,6 +169,10 @@ signals: void abortRequestsSignal(); void allPendingRequestsCompleted(); + +public slots: + void tokenAvailable(); + }; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXclient.pri b/samples/client/petstore/cpp-qt/client/PFXclient.pri index b28c7479d90..7271d7055c6 100644 --- a/samples/client/petstore/cpp-qt/client/PFXclient.pri +++ b/samples/client/petstore/cpp-qt/client/PFXclient.pri @@ -19,7 +19,8 @@ HEADERS += \ $${PWD}/PFXEnum.h \ $${PWD}/PFXHttpFileElement.h \ $${PWD}/PFXServerConfiguration.h \ - $${PWD}/PFXServerVariable.h + $${PWD}/PFXServerVariable.h \ + $${PWD}/PFXOauth.h SOURCES += \ # Models @@ -36,4 +37,5 @@ SOURCES += \ # Others $${PWD}/PFXHelpers.cpp \ $${PWD}/PFXHttpRequest.cpp \ - $${PWD}/PFXHttpFileElement.cpp + $${PWD}/PFXHttpFileElement.cpp \ + $${PWD}/PFXOauth.cpp diff --git a/samples/client/petstore/cpp-tiny/.openapi-generator/FILES b/samples/client/petstore/cpp-tiny/.openapi-generator/FILES index 1024d945064..638b6a51a62 100644 --- a/samples/client/petstore/cpp-tiny/.openapi-generator/FILES +++ b/samples/client/petstore/cpp-tiny/.openapi-generator/FILES @@ -1,5 +1,4 @@ README.md -README.md lib/Models/ApiResponse.cpp lib/Models/ApiResponse.h lib/Models/Category.cpp @@ -14,11 +13,11 @@ lib/Models/Tag.cpp lib/Models/Tag.h lib/Models/User.cpp lib/Models/User.h -lib/service/AbstractService.cpp -lib/service/AbstractService.h lib/service/PetApi.cpp lib/service/PetApi.h lib/service/Response.h +lib/service/Service.cpp +lib/service/Service.h lib/service/StoreApi.cpp lib/service/StoreApi.h lib/service/UserApi.cpp diff --git a/samples/client/petstore/cpp-tiny/lib/service/AbstractService.cpp b/samples/client/petstore/cpp-tiny/lib/service/AbstractService.cpp deleted file mode 100644 index ac7e992cecc..00000000000 --- a/samples/client/petstore/cpp-tiny/lib/service/AbstractService.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "AbstractService.h" -#include "Arduino.h" - - - -void Tiny::AbstractService::begin(std::string url){ - http.begin(String(url.c_str()), test_root_ca); //HTTPS connection -} diff --git a/samples/client/petstore/cpp-tiny/lib/service/AbstractService.h b/samples/client/petstore/cpp-tiny/lib/service/AbstractService.h deleted file mode 100644 index 07214896d7f..00000000000 --- a/samples/client/petstore/cpp-tiny/lib/service/AbstractService.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ -#define TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ - -#include "HTTPClient.h" -#include "Response.h" -namespace Tiny { - -/** -* Class -* Generated with openapi::tiny-cpp-client -*/ -class AbstractService { -public: -HTTPClient http; -std::string basepath = "https://petstore3.swagger.io/api/v3"; // TODO: change to your url - -void begin(std::string url); - -// Go and comment out a certificate in root.cert, if you get an error here -// Certificate from file -const char* test_root_ca = -#include "../../root.cert" -; - -}; // end class -}// namespace Tinyclient - -#endif /* TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ */ diff --git a/samples/client/petstore/cpp-tiny/lib/service/PetApi.cpp b/samples/client/petstore/cpp-tiny/lib/service/PetApi.cpp index 8bf9e141794..a62c6073b6e 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/PetApi.cpp +++ b/samples/client/petstore/cpp-tiny/lib/service/PetApi.cpp @@ -15,31 +15,34 @@ using namespace Tiny; ) { std::string url = basepath + "/pet"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | pet + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | POST - http.addHeader("Content-Type", "application/json"); + // Body | pet payload = pet.toJson().dump(); - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - @@ -64,10 +67,16 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/{petId}"; //petId + + + // Headers | apiKey + addHeader("api_key",apiKey); + // Query | - // Headers | apiKey + // Form | - // Body | + + std::string s_petId("{"); s_petId.append("petId"); @@ -78,19 +87,17 @@ using namespace Tiny; url.erase(pos, s_petId.length()); url.insert(pos, stringify(petId)); - begin(url); std::string payload = ""; // Send Request // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "DELETE", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -107,25 +114,31 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/findByStatus"; // - // Query | status + + // Headers | + + // Query | status + for (auto &x : status){ + addQueryParam("status", std::string(x)); + } + // Form | - // Body | - begin(url); + + std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - std::list obj = std::list(); @@ -167,25 +180,31 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/findByTags"; // - // Query | tags + + // Headers | + + // Query | tags + for (auto &x : tags){ + addQueryParam("tags", std::string(x)); + } + // Form | - // Body | - begin(url); + + std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - std::list obj = std::list(); @@ -227,10 +246,15 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/{petId}"; //petId - // Query | + + // Headers | + + // Query | + // Form | - // Body | + + std::string s_petId("{"); s_petId.append("petId"); @@ -241,19 +265,17 @@ using namespace Tiny; url.erase(pos, s_petId.length()); url.insert(pos, stringify(petId)); - begin(url); std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - @@ -275,31 +297,34 @@ using namespace Tiny; ) { std::string url = basepath + "/pet"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | pet + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | PUT - http.addHeader("Content-Type", "application/json"); + // Body | pet payload = pet.toJson().dump(); - int httpCode = http.sendRequest("PUT", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "PUT", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - @@ -327,10 +352,18 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/{petId}"; //petId - // Query | + + // Headers | + + // Query | + // Form | name status - // Body | + addHeader("Content-Type", "application/x-www-form-urlencoded"); + + addFormParam("name",name); + addFormParam("status",status); + std::string s_petId("{"); s_petId.append("petId"); @@ -341,19 +374,17 @@ using namespace Tiny; url.erase(pos, s_petId.length()); url.insert(pos, stringify(petId)); - begin(url); std::string payload = ""; // Send Request // METHOD | POST - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -376,10 +407,18 @@ using namespace Tiny; ) { std::string url = basepath + "/pet/{petId}/uploadImage"; //petId - // Query | + + // Headers | + + // Query | + // Form | additionalMetadata file - // Body | + addHeader("Content-Type", "application/x-www-form-urlencoded"); + + addFormParam("additionalMetadata",additionalMetadata); + addFormParam("file",file); + std::string s_petId("{"); s_petId.append("petId"); @@ -390,19 +429,17 @@ using namespace Tiny; url.erase(pos, s_petId.length()); url.insert(pos, stringify(petId)); - begin(url); std::string payload = ""; // Send Request // METHOD | POST - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - diff --git a/samples/client/petstore/cpp-tiny/lib/service/PetApi.h b/samples/client/petstore/cpp-tiny/lib/service/PetApi.h index abcb0af0de9..b3839074033 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/PetApi.h +++ b/samples/client/petstore/cpp-tiny/lib/service/PetApi.h @@ -4,7 +4,7 @@ #include "Response.h" #include "Arduino.h" -#include "AbstractService.h" +#include "Service.h" #include "Helpers.h" #include @@ -18,7 +18,7 @@ namespace Tiny { * Generated with openapi::tiny-cpp-client */ -class PetApi : public AbstractService { +class PetApi : public Service { public: PetApi() = default; diff --git a/samples/client/petstore/cpp-tiny/lib/service/Service.cpp b/samples/client/petstore/cpp-tiny/lib/service/Service.cpp new file mode 100644 index 00000000000..fe6cf83bcc3 --- /dev/null +++ b/samples/client/petstore/cpp-tiny/lib/service/Service.cpp @@ -0,0 +1,64 @@ +#include "Service.h" +#include "Arduino.h" + +void Tiny::Service::begin(std::string url){ + http.begin(String(url.c_str()), test_root_ca); //HTTPS connection + + + // reset params + queryParams.begin(); + formParams.begin(); +} + +void Tiny::Service::addHeader(std::string key, std::string value){ + http.addHeader(String(key.c_str()), String(value.c_str())); +} + +void Tiny::Service::addQueryParam(std::string key, std::string value){ + formParams.push_back(std::make_tuple(key, value)); +} + +void Tiny::Service::addFormParam(std::string key, std::string value){ + formParams.push_back(std::make_tuple(key, value)); +} + +int Tiny::Service::sendRequest(std::string url, const char * type, uint8_t * payload, size_t size){ + this->url = url; + prepareRequest(); + + begin(this->url); + + int httpCode = http.sendRequest(type, payload, size); + return httpCode; +} + +void Tiny::Service::prepareRequest(){ + if (!queryParams.empty()){ + this->url += "?" + encodeKeyValueTuple(this->queryParams); + } + + if (!formParams.empty()){ + this->payload = encodeKeyValueTuple(this->formParams); + } +} + +std::string Tiny::Service::encodeKeyValueTuple(std::list> params){ + std::string encoded = ""; + for (auto const& tuple : params) { + encoded += std::get<0>(tuple) + "=" + std::get<1>(tuple) + "&"; + } + + // Remove last '&' char from url + if (! encoded.empty()) + encoded.pop_back(); + + return encoded; +} + + +String Tiny::Service::getResponseBody(){ + String respBody = http.getString(); + http.end(); + return respBody; +} + diff --git a/samples/client/petstore/cpp-tiny/lib/service/Service.h b/samples/client/petstore/cpp-tiny/lib/service/Service.h new file mode 100644 index 00000000000..c7f0634bd42 --- /dev/null +++ b/samples/client/petstore/cpp-tiny/lib/service/Service.h @@ -0,0 +1,43 @@ +#ifndef TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ +#define TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ + +#include "HTTPClient.h" +#include "Response.h" +#include +namespace Tiny { + +/** +* Class +* Generated with openapi::tiny-cpp-client +*/ +class Service { + public: + HTTPClient http; + std::string basepath = "https://petstore3.swagger.io/api/v3"; // TODO: change to your url + std::string url = ""; + std::string payload = ""; + std::list> queryParams; + std::list> formParams; + + int sendRequest(std::string url, const char * type, uint8_t * payload, size_t size); + String getResponseBody(); + + void addQueryParam(std::string key, std::string value); + void addFormParam(std::string key, std::string value); + void addHeader(std::string key, std::string value); + + // Go and comment out a certificate in root.cert, if you get an error here + // Certificate from file + const char* test_root_ca = + #include "../../root.cert" + ; + + private: + void begin(std::string url); + void prepareRequest(); + std::string encodeKeyValueTuple(std::list> params); + +}; // end class +}// namespace Tinyclient + +#endif /* TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ */ diff --git a/samples/client/petstore/cpp-tiny/lib/service/StoreApi.cpp b/samples/client/petstore/cpp-tiny/lib/service/StoreApi.cpp index d52253f03fb..28f0e15ae17 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/StoreApi.cpp +++ b/samples/client/petstore/cpp-tiny/lib/service/StoreApi.cpp @@ -15,10 +15,15 @@ using namespace Tiny; ) { std::string url = basepath + "/store/order/{orderId}"; //orderId - // Query | + + // Headers | + + // Query | + // Form | - // Body | + + std::string s_orderId("{"); s_orderId.append("orderId"); @@ -29,19 +34,17 @@ using namespace Tiny; url.erase(pos, s_orderId.length()); url.insert(pos, stringify(orderId)); - begin(url); std::string payload = ""; // Send Request // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "DELETE", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -55,25 +58,28 @@ using namespace Tiny; ) { std::string url = basepath + "/store/inventory"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | - begin(url); + + std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - //TODO: Implement map logic here @@ -97,10 +103,15 @@ using namespace Tiny; ) { std::string url = basepath + "/store/order/{orderId}"; //orderId - // Query | + + // Headers | + + // Query | + // Form | - // Body | + + std::string s_orderId("{"); s_orderId.append("orderId"); @@ -111,19 +122,17 @@ using namespace Tiny; url.erase(pos, s_orderId.length()); url.insert(pos, stringify(orderId)); - begin(url); std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - @@ -145,31 +154,34 @@ using namespace Tiny; ) { std::string url = basepath + "/store/order"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | order + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | POST - http.addHeader("Content-Type", "application/json"); + // Body | order payload = order.toJson().dump(); - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - diff --git a/samples/client/petstore/cpp-tiny/lib/service/StoreApi.h b/samples/client/petstore/cpp-tiny/lib/service/StoreApi.h index 1bf0db02373..b7a6781bd42 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/StoreApi.h +++ b/samples/client/petstore/cpp-tiny/lib/service/StoreApi.h @@ -4,7 +4,7 @@ #include "Response.h" #include "Arduino.h" -#include "AbstractService.h" +#include "Service.h" #include "Helpers.h" #include @@ -18,7 +18,7 @@ namespace Tiny { * Generated with openapi::tiny-cpp-client */ -class StoreApi : public AbstractService { +class StoreApi : public Service { public: StoreApi() = default; diff --git a/samples/client/petstore/cpp-tiny/lib/service/UserApi.cpp b/samples/client/petstore/cpp-tiny/lib/service/UserApi.cpp index 3323d805a0c..34564a9e7e4 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/UserApi.cpp +++ b/samples/client/petstore/cpp-tiny/lib/service/UserApi.cpp @@ -15,31 +15,34 @@ using namespace Tiny; ) { std::string url = basepath + "/user"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | user + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | POST - http.addHeader("Content-Type", "application/json"); + // Body | user payload = user.toJson().dump(); - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -56,18 +59,23 @@ using namespace Tiny; ) { std::string url = basepath + "/user/createWithArray"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | user + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | POST - http.addHeader("Content-Type", "application/json"); + // Body | user bourne::json tmp_arr = bourne::json::array(); @@ -80,14 +88,12 @@ using namespace Tiny; payload = tmp_arr.dump(); - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -104,18 +110,23 @@ using namespace Tiny; ) { std::string url = basepath + "/user/createWithList"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | user + addHeader("Content-Type", "application/json"); + + - begin(url); std::string payload = ""; // Send Request // METHOD | POST - http.addHeader("Content-Type", "application/json"); + // Body | user bourne::json tmp_arr = bourne::json::array(); @@ -128,14 +139,12 @@ using namespace Tiny; payload = tmp_arr.dump(); - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "POST", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -152,10 +161,15 @@ using namespace Tiny; ) { std::string url = basepath + "/user/{username}"; //username - // Query | + + // Headers | + + // Query | + // Form | - // Body | + + std::string s_username("{"); s_username.append("username"); @@ -166,19 +180,17 @@ using namespace Tiny; url.erase(pos, s_username.length()); url.insert(pos, stringify(username)); - begin(url); std::string payload = ""; // Send Request // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "DELETE", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -195,10 +207,15 @@ using namespace Tiny; ) { std::string url = basepath + "/user/{username}"; //username - // Query | + + // Headers | + + // Query | + // Form | - // Body | + + std::string s_username("{"); s_username.append("username"); @@ -209,19 +226,17 @@ using namespace Tiny; url.erase(pos, s_username.length()); url.insert(pos, stringify(username)); - begin(url); std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - @@ -246,25 +261,30 @@ using namespace Tiny; ) { std::string url = basepath + "/user/login"; // - // Query | username password + + // Headers | + + // Query | username password + addQueryParam("username",username); + addQueryParam("password",password); + // Form | - // Body | - begin(url); + + std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - bourne::json jsonPayload(output_string); @@ -285,25 +305,28 @@ using namespace Tiny; ) { std::string url = basepath + "/user/logout"; // - // Query | + + // Headers | + + // Query | + // Form | - // Body | - begin(url); + + std::string payload = ""; // Send Request // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); + // Body | + int httpCode = sendRequest(url, "GET", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; @@ -323,10 +346,16 @@ using namespace Tiny; ) { std::string url = basepath + "/user/{username}"; //username - // Query | + + // Headers | + + // Query | + // Form | - // Body | user + addHeader("Content-Type", "application/json"); + + std::string s_username("{"); s_username.append("username"); @@ -337,25 +366,22 @@ using namespace Tiny; url.erase(pos, s_username.length()); url.insert(pos, stringify(username)); - begin(url); std::string payload = ""; // Send Request // METHOD | PUT - http.addHeader("Content-Type", "application/json"); + // Body | user payload = user.toJson().dump(); - int httpCode = http.sendRequest("PUT", reinterpret_cast(&payload[0]), payload.length()); + int httpCode = sendRequest(url, "PUT", reinterpret_cast(&payload[0]), payload.length()); // Handle Request - String output = http.getString(); + String output = getResponseBody(); std::string output_string = output.c_str(); - http.end(); - Response response(output, httpCode); return response; diff --git a/samples/client/petstore/cpp-tiny/lib/service/UserApi.h b/samples/client/petstore/cpp-tiny/lib/service/UserApi.h index afdaefa0f8c..b7a42ca811f 100644 --- a/samples/client/petstore/cpp-tiny/lib/service/UserApi.h +++ b/samples/client/petstore/cpp-tiny/lib/service/UserApi.h @@ -4,7 +4,7 @@ #include "Response.h" #include "Arduino.h" -#include "AbstractService.h" +#include "Service.h" #include "Helpers.h" #include @@ -18,7 +18,7 @@ namespace Tiny { * Generated with openapi::tiny-cpp-client */ -class UserApi : public AbstractService { +class UserApi : public Service { public: UserApi() = default; diff --git a/samples/client/petstore/cpp-tiny/platformio.ini b/samples/client/petstore/cpp-tiny/platformio.ini index 00781178d10..35562a0f6f4 100644 --- a/samples/client/petstore/cpp-tiny/platformio.ini +++ b/samples/client/petstore/cpp-tiny/platformio.ini @@ -2,6 +2,6 @@ platform = espressif32 board = nodemcu-32s framework = arduino -lib_deps = https://github.com/steinwurf/bourne.git +lib_deps = https://github.com/steinwurf/bourne.git#9.0.0 extra_scripts = pre_compiling_bourne.py diff --git a/samples/client/petstore/cpp-tiny/root.cert b/samples/client/petstore/cpp-tiny/root.cert index 59d760f1e16..bb78f18edc6 100644 --- a/samples/client/petstore/cpp-tiny/root.cert +++ b/samples/client/petstore/cpp-tiny/root.cert @@ -2,7 +2,7 @@ // Below is two examples of root certificates. // Let's encrypt root certificate -/** + "-----BEGIN CERTIFICATE-----\n" \ "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n" \ "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n" \ @@ -25,10 +25,10 @@ "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n" \ "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" \ "-----END CERTIFICATE-----\n" -*/ + // Amazon_Root_CA_1.pem -/** + "-----BEGIN CERTIFICATE-----\n" \ "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \ "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \ @@ -49,4 +49,5 @@ "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \ "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ "-----END CERTIFICATE-----\n" \ -*/ + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md index 381b20125ee..6afaf65b95a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md @@ -17,7 +17,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 46d46e09809..c445b1abb7c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 254cb0c9fc2..0b425a6b53a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md index f0f67df9685..9bc66067f7a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md @@ -14,7 +14,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 48cb75d22f9..74dc32216c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md index f0f67df9685..9bc66067f7a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md @@ -14,7 +14,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 67233ee9af1..d2fb8de6981 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 381b20125ee..6afaf65b95a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -17,7 +17,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 46d46e09809..c445b1abb7c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index f0f67df9685..9bc66067f7a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -14,7 +14,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index e4650d91357..19789c35952 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/README.md index 10a240ebe02..ac17447c1f7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/README.md @@ -17,7 +17,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index cb8eda42692..eaf3365f5f6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/go/auth_test.go b/samples/client/petstore/go/auth_test.go index 0e532aeff3a..c35e5b24fbc 100644 --- a/samples/client/petstore/go/auth_test.go +++ b/samples/client/petstore/go/auth_test.go @@ -151,7 +151,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: TEST123") { + if !strings.Contains((string)(reqb), "api_key: TEST123") { t.Errorf("APIKey Authentication is missing") } @@ -186,7 +186,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + if !strings.Contains((string)(reqb), "api_key: Bearer TEST123") { t.Errorf("APIKey Authentication is missing") } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index d28e9c440b6..efd991f2700 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -324,7 +324,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index 3448f5381e4..0ee22c086e7 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -14,10 +14,10 @@ wrapper { buildscript { repositories { maven { url "https://repo1.maven.org/maven2" } - maven { url = 'https://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url = 'https://plugins.gradle.org/m2/' } } dependencies { - classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') + classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.24.20') } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index 70fffbf6574..f142a57afdd 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -14,6 +14,7 @@ package org.openapitools.model; import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -190,6 +191,8 @@ public class Pet { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) + + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71c101d18c0..6bb1861f65d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index 4485050c8ef..8563c7d9e70 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java index b7fe3006548..87ec77092d6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9800999e52d..2ae36081062 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index df7ebdaef30..adf9cfe9953 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff20dc37fe..ef3cd0d7b5b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java index 33a1e115a64..a8dcac646f6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 1ab6e6f82f5..931b76ba5bb 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 16a4f5f8f7c..6faa54bcc8a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d60f186db90..9615cb38204 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e4cfeb48b7e..71446f5ad6b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -82,6 +82,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 003c31f2a05..188c8f1d10c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 57d461ec189..c2b21f367fa 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index b9c0545c126..120e2c5dbae 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cda3436cf40..dc865cfd1eb 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 6eaa7d0ed34..4ed427ad59c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -54,6 +54,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b9d8a16c422..c7e5757afad 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 240398a599b..fa149ecb37d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 468fbabce2d..e310dc070d6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -49,6 +49,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 0d0ff4ebf7c..b7b6fb6ceff 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -83,6 +83,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 700fbcb2101..a9c8ebe58d9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -77,6 +77,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index f4c014f28d6..527ecdf078b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -58,6 +58,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 13cabfd8e11..b1e6eb37d89 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -48,6 +48,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index e09e1a9e36c..31b195fd944 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -38,6 +38,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 7248edf4e05..2f338509e14 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -42,6 +42,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 1716b7eb270..8cde8b56df5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -39,6 +39,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java index fe7f103c481..8333a2fa307 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -38,6 +38,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 198196cd1e1..7cdcce8dc41 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -44,6 +44,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index abeb3573a62..e29726d4f9f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -38,6 +38,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 2174e45e590..7c1d862c8cc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -114,6 +114,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 058d90a7d5c..c1eb287075d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -199,6 +199,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 85efa01c58b..23646d18003 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -44,6 +44,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 6e73bfbaae9..aa8bb4eaf83 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -95,6 +95,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 78c2e3a6af8..010417a790f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -42,6 +42,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index b93fd49041f..312111b66ee 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -88,6 +88,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e375e40c856..cfffb60809f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -52,6 +52,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 9e2fdcc88a2..fec50d39067 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -43,6 +43,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 8392493414e..2fdb2549c17 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -46,6 +46,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 6fac233ec4c..ae6d5867dfa 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -39,6 +39,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 531efc60b4c..f84949f1273 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -51,6 +51,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index b1bfac878c3..104a98d8a9f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -39,6 +39,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 58dafe0c194..f8764b08746 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -96,6 +96,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index af789b0521f..31ec4403a00 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -47,6 +47,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 4f9b4042738..1b8506338c9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -101,6 +102,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -208,6 +211,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index daf3efb2c17..2d944c59d87 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -42,6 +42,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index f95a6f08323..71c97902039 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 9559020fd88..6f5fec1f3a2 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -42,6 +42,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 41157b30ab7..95313004c13 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -57,6 +57,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 8387092f47d..cec32e36677 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -61,6 +61,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index 77b6e3dfece..69493bfe139 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -66,6 +66,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 3119578ba3d..0233a8d4af3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -153,6 +153,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a7043fae674..77046bd872a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; private Map> mapOfMapProperty = null; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapProperty(Map mapProperty) { 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 f1c32090efd..ee588a3cf4c 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 @@ -51,6 +51,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 3f477a2a768..cecc19e110a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6e666fe3c7e..683789eea86 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 48b3d029ccd..9b3859e613c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 8e15fb418ed..9df38a08377 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -43,6 +43,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index 69cfdbbd8e0..8a43bc0fbb0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 7e40874a37e..8ce005bca55 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -39,6 +39,8 @@ public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public DeprecatedObject() { + } public DeprecatedObject name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 5e6f93c6cfd..c45d328d582 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index b4de1289303..a33250dbb6d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -217,6 +217,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f58670f41a5..116da93a92b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java index 67e5208c76c..23e8d2d8476 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java @@ -37,6 +37,8 @@ public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; private String bar = "bar"; + public Foo() { + } public Foo bar(String bar) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 9f5c915c38f..999d81c6576 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -102,6 +102,8 @@ public class FormatTest { public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; private String patternWithDigitsAndDelimiter; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 9cf29c66914..ca53feb8faa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -42,6 +42,8 @@ public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; private JsonNullable nullableMessage = JsonNullable.undefined(); + public HealthCheckResult() { + } public HealthCheckResult nullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 16046669b22..bd42f4375dd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -38,6 +38,8 @@ public class InlineResponseDefault { public static final String JSON_PROPERTY_STRING = "string"; private Foo string; + public InlineResponseDefault() { + } public InlineResponseDefault string(Foo string) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 13d7c1b4410..daec1172792 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4ccffcf5965..d0913fb877b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index 5db5cbda3f3..3fbb133aafd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -92,6 +92,8 @@ public class NullableClass extends HashMap { public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; private Map objectItemsNullable = null; + public NullableClass() { + } public NullableClass integerProp(Integer integerProp) { this.integerProp = JsonNullable.of(integerProp); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 398567fe28b..46020e41209 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -53,6 +53,8 @@ public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_BARS = "bars"; private List bars = null; + public ObjectWithDeprecatedFields() { + } public ObjectWithDeprecatedFields uuid(String uuid) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 322b7654542..736bb3cc795 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index 109f7adc9f6..575601736ab 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 64d8bb8e20d..6dfd8bbdcf2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -38,6 +38,8 @@ public class OuterObjectWithEnumProperty { public static final String JSON_PROPERTY_VALUE = "value"; private OuterEnumInteger value; + public OuterObjectWithEnumProperty() { + } public OuterObjectWithEnumProperty value(OuterEnumInteger value) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 3069ad118ca..64f2debe039 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index d72baf59f4b..95d47212ac4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e10277c6a2f..fa757a9cd8a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 4485050c8ef..8563c7d9e70 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 @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 3f477a2a768..cecc19e110a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6e666fe3c7e..683789eea86 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 48b3d029ccd..9b3859e613c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 5e6f93c6cfd..c45d328d582 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f58670f41a5..116da93a92b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index b7fe3006548..87ec77092d6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 13d7c1b4410..daec1172792 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4ccffcf5965..d0913fb877b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 3069ad118ca..64f2debe039 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 44de66aed83..6ac9db96adc 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9a6645dc688..1e377b531d5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index a2ddbbeb7d8..8fac0ca2988 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e10277c6a2f..fa757a9cd8a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 4485050c8ef..8563c7d9e70 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 @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 3f477a2a768..cecc19e110a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6e666fe3c7e..683789eea86 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 48b3d029ccd..9b3859e613c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 5e6f93c6cfd..c45d328d582 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f58670f41a5..116da93a92b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index b7fe3006548..87ec77092d6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 13d7c1b4410..daec1172792 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4ccffcf5965..d0913fb877b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 3069ad118ca..64f2debe039 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 44de66aed83..6ac9db96adc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9a6645dc688..1e377b531d5 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index a2ddbbeb7d8..8fac0ca2988 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index 40621886ce3..7618c2e444b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -127,3 +129,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index 8a771818fa1..b850beee9e1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -183,6 +183,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -306,5 +346,6 @@ 1.3.5 4.13.2 8.3.1 + 2.17.3 diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index d970795e97c..b5bf6b9e2b1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesAnyType { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 4afc2085d69..1413c919979 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesArray { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8ff5a18d199..00ea9a8d640 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesBoolean { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b916a854889..4224f4737cd 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -83,6 +83,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 8ade28299ea..c67028d1daa 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesInteger { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 542c061cc45..7c577f59c30 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesNumber { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fa3c9b1cc82..55f7b080f5a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 449edb84e2b..a833e62de13 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesString { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java index 7b8d2481f2c..f0e2f9e2ade 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java @@ -55,6 +55,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { this.className = className; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5d3b478c12e..a6526e609cc 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b59275573c8..5fd34060846 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java index db2613ad801..5a806551fb0 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -50,6 +50,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java index 4044bc0ac77..73ccb294016 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java @@ -84,6 +84,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 7fc1d436851..f0822b5887d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -78,6 +78,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java index eea6cd4b4f0..370dc9ab8b9 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java @@ -59,6 +59,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java index 6870d8028a7..c66294bbd00 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java index 298ba7d9b41..4b48d9f8587 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -39,6 +39,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java index 3addae65d9b..a9723092a95 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java @@ -43,6 +43,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java index 340fb74689a..d23f59f5935 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,6 +40,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java index 2535057113d..99e45029b65 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java @@ -39,6 +39,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { this.client = client; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java index 741ba4ccebf..ed024e16348 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java @@ -45,6 +45,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java index 06b4ea85759..43845b6171f 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -39,6 +39,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java index d381b594cb0..418e879befc 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -115,6 +115,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java index 6932ee63186..be96737e855 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java @@ -200,6 +200,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2673c8add96..575eaed95b2 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -45,6 +45,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { this.file = file; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java index 51339f94b27..588afd472ff 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java @@ -96,6 +96,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7bba0219b1c..9c1665a812b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -43,6 +43,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java index 37569ca7505..1c862c16fb1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java @@ -89,6 +89,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index bc6bf26391a..54da952af18 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -53,6 +53,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java index fc03371ca82..0573efb7bd0 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java @@ -44,6 +44,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84a4c7c8273..f2112a0d961 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -47,6 +47,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java index 6c3ed4c8a61..57f315ddad8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,6 +40,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java index 19cd2b35505..b9a4ee16408 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java @@ -52,6 +52,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java index ed004b9d1f8..b2f8f39868e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -40,6 +40,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java index 37d3a13ed51..71af3722e6e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java @@ -97,6 +97,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java index 1635472a57b..b09d4549256 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -48,6 +48,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java index f0ddb6dc93b..880bd66df64 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -102,6 +103,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { this.id = id; @@ -205,6 +208,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index dd49c31a87f..9775939c277 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,6 +43,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7e4d909b9eb..733b9e116cd 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -39,6 +39,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java index d249df2c14b..9d81c6f11a1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java @@ -43,6 +43,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f2b8e65ab9..10885beacea 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -58,6 +58,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 951704eef73..7fe75feecc1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -62,6 +62,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java index c036a48e03a..e985f0d2c54 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java @@ -67,6 +67,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java index f27ad5b67b7..c4028c3c7c1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java @@ -154,6 +154,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 9cf958ea4ed..57f7cc9b703 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -127,3 +129,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 5fb184b6803..2fc62928ae5 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -183,6 +183,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -306,5 +346,6 @@ 1.3.5 4.13.2 8.3.1 + 2.17.3 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index d970795e97c..b5bf6b9e2b1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesAnyType { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 4afc2085d69..1413c919979 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesArray { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8ff5a18d199..00ea9a8d640 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesBoolean { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b916a854889..4224f4737cd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -83,6 +83,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 8ade28299ea..c67028d1daa 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesInteger { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 542c061cc45..7c577f59c30 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesNumber { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fa3c9b1cc82..55f7b080f5a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 449edb84e2b..a833e62de13 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesString { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { this.name = name; 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 7b8d2481f2c..f0e2f9e2ade 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 @@ -55,6 +55,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { this.className = className; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5d3b478c12e..a6526e609cc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b59275573c8..5fd34060846 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index db2613ad801..5a806551fb0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -50,6 +50,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index 4044bc0ac77..73ccb294016 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -84,6 +84,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 7fc1d436851..f0822b5887d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -78,6 +78,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index eea6cd4b4f0..370dc9ab8b9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -59,6 +59,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 6870d8028a7..c66294bbd00 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 298ba7d9b41..4b48d9f8587 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -39,6 +39,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 3addae65d9b..a9723092a95 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -43,6 +43,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 340fb74689a..d23f59f5935 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,6 +40,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 2535057113d..99e45029b65 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -39,6 +39,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { this.client = client; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 741ba4ccebf..ed024e16348 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -45,6 +45,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index 06b4ea85759..43845b6171f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -39,6 +39,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index d381b594cb0..418e879befc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -115,6 +115,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 6932ee63186..be96737e855 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -200,6 +200,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2673c8add96..575eaed95b2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -45,6 +45,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { this.file = file; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 230e9c9575d..1dc1a8505b1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -96,6 +96,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7bba0219b1c..9c1665a812b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -43,6 +43,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 37569ca7505..1c862c16fb1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -89,6 +89,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 41902730736..9b0e0f06add 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -53,6 +53,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index fc03371ca82..0573efb7bd0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -44,6 +44,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84a4c7c8273..f2112a0d961 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -47,6 +47,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 6c3ed4c8a61..57f315ddad8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,6 +40,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 19cd2b35505..b9a4ee16408 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -52,6 +52,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ed004b9d1f8..b2f8f39868e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -40,6 +40,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 7e79daffed5..4d60a208f12 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -97,6 +97,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 1635472a57b..b09d4549256 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -48,6 +48,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index f0ddb6dc93b..880bd66df64 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -102,6 +103,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { this.id = id; @@ -205,6 +208,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index dd49c31a87f..9775939c277 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,6 +43,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7e4d909b9eb..733b9e116cd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -39,6 +39,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index d249df2c14b..9d81c6f11a1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -43,6 +43,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f2b8e65ab9..10885beacea 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -58,6 +58,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 951704eef73..7fe75feecc1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -62,6 +62,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index c036a48e03a..e985f0d2c54 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -67,6 +67,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index f27ad5b67b7..c4028c3c7c1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -154,6 +154,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 9099a60fd45..c4899ad6165 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb9d75b9c7d..61b9f3bb9c7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index e214a2cffbd..ff57c303501 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a02ee11c044..962dd843aa6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -82,6 +82,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c37cb4cbee9..cc0598a14a0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index d46e8293c89..1ec3719074d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 26332722324..6000e007e6e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f79928430cd..f3719fe70b0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index 3e9d6e541c1..cf2f2ca676e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -55,6 +55,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { this.className = className; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 6dad127d9ee..3c967d673eb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5e59c851d5f..6e8e2dbd567 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java index a3aef6b1ba1..65a97a59310 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -49,6 +49,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java index df288c16110..5844b15aed5 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java @@ -84,6 +84,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 790e761e29b..eac101499d0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -77,6 +77,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java index 89294f5ef6e..f6d78b167bb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java @@ -58,6 +58,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index 85d0f01a6b2..942947f6202 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java index 39934c2a02c..392b230e3de 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -38,6 +38,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java index 130ef225841..3f88067fb66 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java @@ -42,6 +42,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java index df97250205e..e47f0d90318 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java @@ -39,6 +39,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java index c6bdbf4ba69..00aae1cf1d3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java @@ -38,6 +38,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { this.client = client; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java index 9baad459f3a..1ffd0598fca 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java @@ -45,6 +45,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java index d5537436343..8972d39dbd8 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -38,6 +38,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java index cc9944eec59..0c54e10644f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -114,6 +114,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index 7e18b96f43c..8410c216b65 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -199,6 +199,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 74e4a914edf..38568952029 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -44,6 +44,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { this.file = file; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java index ff00345d0e8..4034343af64 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java @@ -95,6 +95,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index a8573d9708f..5000d75b3d6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -42,6 +42,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java index 10f46d27b36..6c755f631cb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java @@ -88,6 +88,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index da802dcc32a..16c239c4be1 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -52,6 +52,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java index 95ce97e156c..41d841a105f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java @@ -43,6 +43,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5def3f4a8d8..74fe9c1a733 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -46,6 +46,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java index 9640108d1b5..6e96907a0de 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -39,6 +39,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java index fd3b90dddf0..2647b758ccd 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java @@ -51,6 +51,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java index 296aeb125a6..a94432cdd5c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -39,6 +39,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java index a702e67995f..72951b11fa0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java @@ -96,6 +96,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java index 2ff2cfeb31a..15051508031 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -47,6 +47,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java index f9ca570f4bd..c8e5d637290 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -101,6 +102,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { this.id = id; @@ -204,6 +207,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f36aeefc3be..c8144295aad 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -42,6 +42,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java index 8a3b9353821..1a84aa41d96 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java index d376bd24855..3e90951a313 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java @@ -42,6 +42,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index cbdb1368478..c21f40108b3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -57,6 +57,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java index aa0a3649256..37373f3546a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -61,6 +61,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java index 4d4cf4b3c1a..07a5fd5616c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java @@ -66,6 +66,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java index b72621b7cff..c6cbeb9e602 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java @@ -153,6 +153,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 9099a60fd45..c4899ad6165 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb9d75b9c7d..61b9f3bb9c7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index e214a2cffbd..ff57c303501 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a02ee11c044..962dd843aa6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -82,6 +82,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c37cb4cbee9..cc0598a14a0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index d46e8293c89..1ec3719074d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 26332722324..6000e007e6e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f79928430cd..f3719fe70b0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { this.name = name; 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 3e9d6e541c1..cf2f2ca676e 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 @@ -55,6 +55,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { this.className = className; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 6dad127d9ee..3c967d673eb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5e59c851d5f..6e8e2dbd567 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -41,6 +41,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index a3aef6b1ba1..65a97a59310 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -49,6 +49,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java index df288c16110..5844b15aed5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -84,6 +84,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 790e761e29b..eac101499d0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -77,6 +77,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index 89294f5ef6e..f6d78b167bb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -58,6 +58,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index 85d0f01a6b2..942947f6202 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 39934c2a02c..392b230e3de 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -38,6 +38,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 130ef225841..3f88067fb66 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -42,6 +42,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index df97250205e..e47f0d90318 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -39,6 +39,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index c6bdbf4ba69..00aae1cf1d3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -38,6 +38,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { this.client = client; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index 9baad459f3a..1ffd0598fca 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -45,6 +45,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index d5537436343..8972d39dbd8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -38,6 +38,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { this.breed = breed; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index cc9944eec59..0c54e10644f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -114,6 +114,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index 7e18b96f43c..8410c216b65 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -199,6 +199,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 74e4a914edf..38568952029 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -44,6 +44,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { this.file = file; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index ff00345d0e8..4034343af64 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -95,6 +95,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index a8573d9708f..5000d75b3d6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -42,6 +42,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index 10f46d27b36..6c755f631cb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -88,6 +88,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index da802dcc32a..16c239c4be1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -52,6 +52,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index 95ce97e156c..41d841a105f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -43,6 +43,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5def3f4a8d8..74fe9c1a733 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -46,6 +46,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 9640108d1b5..6e96907a0de 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -39,6 +39,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index fd3b90dddf0..2647b758ccd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -51,6 +51,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { this.name = name; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index 296aeb125a6..a94432cdd5c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -39,6 +39,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index a702e67995f..72951b11fa0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -96,6 +96,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index 2ff2cfeb31a..15051508031 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -47,6 +47,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index f9ca570f4bd..c8e5d637290 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -101,6 +102,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { this.id = id; @@ -204,6 +207,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f36aeefc3be..c8144295aad 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -42,6 +42,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index 8a3b9353821..1a84aa41d96 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index d376bd24855..3e90951a313 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -42,6 +42,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index cbdb1368478..c21f40108b3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -57,6 +57,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index aa0a3649256..37373f3546a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -61,6 +61,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 4d4cf4b3c1a..07a5fd5616c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -66,6 +66,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { this.id = id; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index b72621b7cff..c6cbeb9e602 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -153,6 +153,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 24820c068c0..3344fafe8de 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -12,6 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -123,3 +125,30 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 3ce94aa5dd4..9c060a66c62 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -179,6 +179,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -297,5 +339,6 @@ 1.3.5 4.13.2 UTF-8 + 2.17.3 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 51a21bdbe9f..32fb9f79f0f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -24,6 +24,7 @@ import okhttp3.internal.http.HttpMethod; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; import org.threeten.bp.LocalDate; @@ -131,6 +132,8 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID */ public ApiClient(String clientId) { this(clientId, null, null); @@ -138,6 +141,9 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, Map parameters) { this(clientId, null, parameters); @@ -145,6 +151,10 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, String clientSecret, Map parameters) { this(null, clientId, clientSecret, parameters); @@ -152,6 +162,11 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { init(); @@ -845,17 +860,23 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -1182,20 +1203,16 @@ public class ApiClient { * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1214,6 +1231,13 @@ public class ApiClient { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1320,14 +1344,18 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public 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); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1548,4 +1576,26 @@ public class ApiClient { } return path; } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java index bd303bed5f9..5851f0405ad 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java @@ -19,6 +19,7 @@ import java.util.List; /** *

ApiException class.

*/ +@SuppressWarnings("serial") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java index dbd3bf1312e..274416e5ded 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java @@ -151,6 +151,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -179,7 +186,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 62f86373b3c..c93b4ce865a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -101,7 +101,9 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index f0df2ec4fe2..06844d6e641 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -109,7 +109,9 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -224,7 +226,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -338,7 +342,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -452,7 +458,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -566,7 +574,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -680,7 +690,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -797,7 +809,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -920,7 +934,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1109,7 +1125,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "http_basic_test" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1303,7 +1321,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1431,7 +1451,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1636,7 +1658,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1760,7 +1784,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1892,7 +1918,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 8471b2703c2..ab4032b3ba4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -101,7 +101,9 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key_query" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java index 10f6969d302..164b243db0a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java @@ -105,7 +105,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -227,7 +229,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -350,7 +354,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -476,7 +482,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -608,7 +616,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -736,7 +746,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -871,7 +883,9 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1003,7 +1017,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1139,7 +1155,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java index c3764e15bf5..795c365962f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java @@ -103,7 +103,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -220,7 +222,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -334,7 +338,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -460,7 +466,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index 4abe365e3ad..63385ff3554 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -101,7 +101,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -216,7 +218,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -331,7 +335,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -448,7 +454,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -569,7 +577,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -698,7 +708,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -827,7 +839,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -937,7 +951,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 8e03da2a679..35aa7184d26 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -56,7 +58,8 @@ 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/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/Authentication.java index 5c558b1d5ab..c59d11e0ce9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/Authentication.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -25,6 +27,10 @@ public interface Authentication { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 959a3211653..b4641c4217c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -14,9 +14,11 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -43,7 +45,8 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index e9d4c678963..460ad224963 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -46,8 +48,9 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuth.java index 0f145f8b23c..08a855ec5f9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuth.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -31,7 +33,8 @@ 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/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..911df8d3a37 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -1,5 +1,6 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import okhttp3.Interceptor; @@ -18,6 +19,7 @@ import org.apache.oltu.oauth2.common.message.types.GrantType; import java.io.IOException; import java.net.HttpURLConnection; +import java.net.URI; import java.util.Map; import java.util.List; @@ -173,7 +175,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { // Applying authorization to parameters is performed in the retryingIntercept method @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 { // No implementation necessary } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb0175c213..1b5a3cd2239 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 90e9afca2f0..6835e103b62 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f6e70331f6e..3f2f1b3ba82 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0495881506d..21db6cb109f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -77,6 +77,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 208dfdbc15f..c90f346b182 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b008b847a7e..b9a1d371fd3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c2ce3b2fbe2..a61d030c6c0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcecf6e69dd..4745fed6651 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java index ee3cf38a18a..24f916d3add 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java @@ -40,7 +40,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7e3ba8195c7..8c7d7694734 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 279edaea8a7..2408d257708 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java index b1bfac1da86..1c7469d68e0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -44,6 +44,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java index ee503f76942..37b2bb735b9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java @@ -86,7 +86,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a6bdb2bbe3f..8334448ffdf 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -84,6 +84,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java index 42909659d9c..a99f3586985 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,6 +53,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java index 19705043a2f..b226ce008f2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java index 6be8b4534b1..39c740ffe3f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java index fdbddf336d3..9d7c0e4a1cd 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java @@ -37,6 +37,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java index f43b881b90c..eb1d43e00eb 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java index 1702dbadd88..8e5e1694ace 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java index 5c80057e78e..d4935b3df27 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java index 9e311a1f6af..b1f42a5f620 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java index 9a9c2f1a59a..2b249f35495 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -133,6 +133,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java index 47007ec6f1b..55ddcb829be 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java @@ -242,6 +242,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a6c4008d1e9..d3feb88b1a9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,6 +39,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java index af715329445..52900682b0f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,6 +90,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7f915754ffa..b8194dc1df6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,6 +37,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java index f8fedfcde0c..cc0b38f6c4d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java @@ -95,6 +95,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0c225d1f6cd..1c705d4b1ee 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,6 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java index f11d9e5d570..46150911764 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 595d829ad8d..93e9feb5b86 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,6 +41,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java index dc27972cb67..4c0e74f87eb 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java index c6fd4106f2b..a0bd099370d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java @@ -46,6 +46,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java index 172856aaf7a..46830867289 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java index 34b170e3ecd..530f0eefd41 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java @@ -103,6 +103,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java index 32829a45215..d8c60dcf97a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,6 +42,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java index 8b0094ed608..1c1c47105f9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java @@ -108,6 +108,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 23ca124c518..e452bf03a01 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,6 +37,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java index ffd53c78dee..271e41f8323 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java index f34a659e794..181b1e65048 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java @@ -37,6 +37,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ed5494ea76b..f9fdaf50fe4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,6 +52,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2fd9419115d..a19d60e9022 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -56,6 +56,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java index 86d4751120a..166fea9628c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java @@ -61,6 +61,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java index a09ec289d51..197aac987bc 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java @@ -148,6 +148,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 8646aedd851..2f389381242 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -12,6 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -122,3 +124,30 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 3235bef8854..098e028ec8f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -179,6 +179,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -299,5 +341,6 @@ 1.3.5 4.13.2 UTF-8 + 2.17.3 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 2db2aaf44b4..67508f676bf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -18,6 +18,7 @@ import okhttp3.internal.http.HttpMethod; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; import org.threeten.bp.LocalDate; @@ -123,6 +124,8 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID */ public ApiClient(String clientId) { this(clientId, null, null); @@ -130,6 +133,9 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, Map parameters) { this(clientId, null, parameters); @@ -137,6 +143,10 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, String clientSecret, Map parameters) { this(null, clientId, clientSecret, parameters); @@ -144,6 +154,11 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { init(); @@ -846,17 +861,23 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -1183,20 +1204,16 @@ public class ApiClient { * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1215,6 +1232,13 @@ public class ApiClient { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1321,14 +1345,18 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public 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); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1480,4 +1508,26 @@ public class ApiClient { throw new AssertionError(e); } } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java index bd303bed5f9..5851f0405ad 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java @@ -19,6 +19,7 @@ import java.util.List; /** *

ApiException class.

*/ +@SuppressWarnings("serial") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index dbd3bf1312e..274416e5ded 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -151,6 +151,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -179,7 +186,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5b687f2320f..7bfa5d1220e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -90,7 +90,9 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 5f9df636b4c..28d018f4bc4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -98,7 +98,9 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -205,7 +207,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -311,7 +315,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -417,7 +423,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -523,7 +531,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -629,7 +639,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -741,7 +753,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -856,7 +870,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1037,7 +1053,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "http_basic_test" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1241,7 +1259,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1379,7 +1399,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1576,7 +1598,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1692,7 +1716,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1831,7 +1857,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 61030114321..54cef2eb37b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -90,7 +90,9 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key_query" }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index ecfa67f0a36..71a69f58786 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -94,7 +94,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -211,7 +213,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -329,7 +333,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -450,7 +456,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -574,7 +582,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -694,7 +704,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -821,7 +833,9 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -945,7 +959,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1073,7 +1089,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index 437bff5280f..13b63b31ec1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -92,7 +92,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -201,7 +203,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -307,7 +311,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -425,7 +431,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index 3c78c4049b5..af4538427c1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -90,7 +90,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -197,7 +199,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -304,7 +308,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -413,7 +419,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -526,7 +534,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -653,7 +663,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -774,7 +786,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -876,7 +890,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 8e03da2a679..35aa7184d26 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -56,7 +58,8 @@ 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/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/Authentication.java index 5c558b1d5ab..c59d11e0ce9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/Authentication.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -25,6 +27,10 @@ public interface Authentication { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 959a3211653..b4641c4217c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -14,9 +14,11 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -43,7 +45,8 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index e9d4c678963..460ad224963 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -46,8 +48,9 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuth.java index 0f145f8b23c..08a855ec5f9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuth.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -31,7 +33,8 @@ 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/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..911df8d3a37 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -1,5 +1,6 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import okhttp3.Interceptor; @@ -18,6 +19,7 @@ import org.apache.oltu.oauth2.common.message.types.GrantType; import java.io.IOException; import java.net.HttpURLConnection; +import java.net.URI; import java.util.Map; import java.util.List; @@ -173,7 +175,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { // Applying authorization to parameters is performed in the retryingIntercept method @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 { // No implementation necessary } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8817e7d1ac9..931441b9714 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap impleme @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesAnyType() { + public AdditionalPropertiesAnyType() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0565a50bd4f..17e44d0631d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesArray extends HashMap implements @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesArray() { + public AdditionalPropertiesArray() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 92290427d32..6e6b4f80007 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap implem @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesBoolean() { + public AdditionalPropertiesBoolean() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a310ccb549d..055b7d0995b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -79,7 +79,7 @@ public class AdditionalPropertiesClass implements Parcelable { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; - public AdditionalPropertiesClass() { + public AdditionalPropertiesClass() { } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e73be2717a8..249f410a119 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap implem @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesInteger() { + public AdditionalPropertiesInteger() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 3a7693d9cd5..df925edf368 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap impl @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesNumber() { + public AdditionalPropertiesNumber() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 929ee8601ad..9e258fe2e8f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject extends HashMap implements @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesObject() { + public AdditionalPropertiesObject() { super(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 0f752ea3d58..f704a72d17f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesString extends HashMap implemen @SerializedName(SERIALIZED_NAME_NAME) private String name; - public AdditionalPropertiesString() { + public AdditionalPropertiesString() { super(); } 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 b0e9612d65a..db195751a0b 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 @@ -42,7 +42,7 @@ public class Animal implements Parcelable { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 6af2a91abfe..9d2410adfca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; - public ArrayOfArrayOfNumberOnly() { + public ArrayOfArrayOfNumberOnly() { } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 1751cd7e672..0aea024ea4c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ public class ArrayOfNumberOnly implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; - public ArrayOfNumberOnly() { + public ArrayOfNumberOnly() { } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java index 366791bcb79..216ff2dd0ca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -46,7 +46,7 @@ public class ArrayTest implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; - public ArrayTest() { + public ArrayTest() { } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java index c2da68b7d26..e1ac2c6f3b5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat implements Parcelable { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { super(); this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 1ed766c1e78..96fbe115dff 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -86,7 +86,7 @@ public class BigCatAllOf implements Parcelable { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCatAllOf() { + public BigCatAllOf() { } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java index 48a61ddc2d2..a93444bb063 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java @@ -55,7 +55,7 @@ public class Capitalization implements Parcelable { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; - public Capitalization() { + public Capitalization() { } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java index ef9c0e620a0..ca69726075e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java @@ -38,7 +38,7 @@ public class Cat extends Animal implements Parcelable { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { super(); this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java index 26415a2d8c4..85a45fb3aa0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -35,7 +35,7 @@ public class CatAllOf implements Parcelable { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public CatAllOf() { + public CatAllOf() { } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java index 018409afce4..39e56c2222f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java @@ -39,7 +39,7 @@ public class Category implements Parcelable { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; - public Category() { + public Category() { } public Category id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java index 4bee921b00d..e15f6e8788b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel implements Parcelable { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; - public ClassModel() { + public ClassModel() { } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java index 9a8db7cfb77..975c9dfa7ee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java @@ -35,7 +35,7 @@ public class Client implements Parcelable { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; - public Client() { + public Client() { } public Client client(String client) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index 9e9f2f09a32..98454aa74b2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal implements Parcelable { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { super(); this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java index d931385d39b..c95c1494c91 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -35,7 +35,7 @@ public class DogAllOf implements Parcelable { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public DogAllOf() { + public DogAllOf() { } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java index 60a12b75f6e..991b1296170 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -135,7 +135,7 @@ public class EnumArrays implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; - public EnumArrays() { + public EnumArrays() { } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index f1e72e0865e..0e5d108906f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -244,7 +244,7 @@ public class EnumTest implements Parcelable { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; - public EnumTest() { + public EnumTest() { } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index d526b21a8ac..e8334615caf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -41,7 +41,7 @@ public class FileSchemaTestClass implements Parcelable { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; - public FileSchemaTestClass() { + public FileSchemaTestClass() { } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index 20be3320813..fbc06e99518 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -92,7 +92,7 @@ public class FormatTest implements Parcelable { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; - public FormatTest() { + public FormatTest() { } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f6346371be2..ec3a4545cfe 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -39,7 +39,17 @@ public class HasOnlyReadOnly implements Parcelable { @SerializedName(SERIALIZED_NAME_FOO) private String foo; - public HasOnlyReadOnly() { + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index bbdeb5ea44e..701638d5bda 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -97,7 +97,7 @@ public class MapTest implements Parcelable { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; - public MapTest() { + public MapTest() { } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f47bd4e4500..f166778d042 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; - public MixedPropertiesAndAdditionalPropertiesClass() { + public MixedPropertiesAndAdditionalPropertiesClass() { } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java index 1370c6be17d..0a93be51b99 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response implements Parcelable { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; - public Model200Response() { + public Model200Response() { } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 122dc4d429a..74b58c304b7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -43,7 +43,7 @@ public class ModelApiResponse implements Parcelable { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; - public ModelApiResponse() { + public ModelApiResponse() { } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java index 3684c5be5c7..a6e15d195ab 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn implements Parcelable { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; - public ModelReturn() { + public ModelReturn() { } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java index 47818443963..66a024bf959 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,17 @@ public class Name implements Parcelable { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; - public Name() { + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; } public Name name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java index c3929e2ce7a..b4b8b99a31f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly implements Parcelable { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; - public NumberOnly() { + public NumberOnly() { } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index d6ec2f881d0..0628c9213ae 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -105,7 +105,7 @@ public class Order implements Parcelable { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; - public Order() { + public Order() { } public Order id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index 6b84b6f36f4..4a61f7034e5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -44,7 +44,7 @@ public class OuterComposite implements Parcelable { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; - public OuterComposite() { + public OuterComposite() { } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index 4f96df5e038..f28f1fb90b1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -110,7 +110,7 @@ public class Pet implements Parcelable { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; - public Pet() { + public Pet() { } public Pet id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index abaf904bbba..c892894a70d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -39,7 +39,15 @@ public class ReadOnlyFirst implements Parcelable { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; - public ReadOnlyFirst() { + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java index 2104c1e6062..0304fb7454b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName implements Parcelable { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; - public SpecialModelName() { + public SpecialModelName() { } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java index 9f44e5098b8..1f040b328d2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag implements Parcelable { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public Tag() { + public Tag() { } public Tag id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9a7327432fd..f84bf0c8e19 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -54,7 +54,7 @@ public class TypeHolderDefault implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); - public TypeHolderDefault() { + public TypeHolderDefault() { } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d47ddb64057..05f329b8fa5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -58,7 +58,7 @@ public class TypeHolderExample implements Parcelable { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); - public TypeHolderExample() { + public TypeHolderExample() { } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java index 49df39a3805..04646e06675 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java @@ -63,7 +63,7 @@ public class User implements Parcelable { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; - public User() { + public User() { } public User id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java index 0e7fe46670d..e0dfd0b338c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java @@ -150,7 +150,7 @@ public class XmlItem implements Parcelable { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; - public XmlItem() { + public XmlItem() { } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 10b2c272abb..c88a30679cf 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -12,6 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -122,3 +124,30 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index f3c9b191c95..da2dbbe58e7 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -179,6 +179,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -292,5 +334,6 @@ 1.3.5 4.13.2 UTF-8 + 2.17.3 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 2db2aaf44b4..67508f676bf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -18,6 +18,7 @@ import okhttp3.internal.http.HttpMethod; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; import okio.BufferedSink; import okio.Okio; import org.threeten.bp.LocalDate; @@ -123,6 +124,8 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID */ public ApiClient(String clientId) { this(clientId, null, null); @@ -130,6 +133,9 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, Map parameters) { this(clientId, null, parameters); @@ -137,6 +143,10 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String clientId, String clientSecret, Map parameters) { this(null, clientId, clientSecret, parameters); @@ -144,6 +154,11 @@ public class ApiClient { /** * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters */ public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { init(); @@ -846,17 +861,23 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * returns null. If it matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { return "application/json"; } + for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } + return contentTypes[0]; } @@ -1183,20 +1204,16 @@ public class ApiClient { * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } + // prepare HTTP request body RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; } else if ("application/x-www-form-urlencoded".equals(contentType)) { @@ -1215,6 +1232,13 @@ public class ApiClient { reqBody = serialize(body, contentType); } + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + // Associate callback with request (if not null) so interceptor can // access it when creating ProgressResponseBody reqBuilder.tag(callback); @@ -1321,14 +1345,18 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + public 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); + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } @@ -1480,4 +1508,26 @@ public class ApiClient { throw new AssertionError(e); } } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java index bd303bed5f9..5851f0405ad 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java @@ -19,6 +19,7 @@ import java.util.List; /** *

ApiException class.

*/ +@SuppressWarnings("serial") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index dbd3bf1312e..274416e5ded 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -151,6 +151,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -179,7 +186,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5b687f2320f..7bfa5d1220e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -90,7 +90,9 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 5f9df636b4c..28d018f4bc4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -98,7 +98,9 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -205,7 +207,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -311,7 +315,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -417,7 +423,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -523,7 +531,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -629,7 +639,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -741,7 +753,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -856,7 +870,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1037,7 +1053,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "http_basic_test" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1241,7 +1259,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1379,7 +1399,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1576,7 +1598,9 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1692,7 +1716,9 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1831,7 +1857,9 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 61030114321..54cef2eb37b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -90,7 +90,9 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key_query" }; return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index ecfa67f0a36..71a69f58786 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -94,7 +94,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -211,7 +213,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -329,7 +333,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -450,7 +456,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -574,7 +582,9 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -694,7 +704,9 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -821,7 +833,9 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -945,7 +959,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1073,7 +1089,9 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index 437bff5280f..13b63b31ec1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -92,7 +92,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -201,7 +203,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { "api_key" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -307,7 +311,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -425,7 +431,9 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index 3c78c4049b5..af4538427c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -90,7 +90,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -197,7 +199,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -304,7 +308,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -413,7 +419,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -526,7 +534,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -653,7 +663,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -774,7 +786,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -876,7 +890,9 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 8e03da2a679..35aa7184d26 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -56,7 +58,8 @@ 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/okhttp-gson/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/Authentication.java index 5c558b1d5ab..c59d11e0ce9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/Authentication.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -25,6 +27,10 @@ public interface Authentication { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 959a3211653..b4641c4217c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -14,9 +14,11 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; import okhttp3.Credentials; +import java.net.URI; import java.util.Map; import java.util.List; @@ -43,7 +45,8 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index e9d4c678963..460ad224963 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -13,8 +13,10 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; +import java.net.URI; import java.util.Map; import java.util.List; @@ -46,8 +48,9 @@ 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; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuth.java index 0f145f8b23c..08a855ec5f9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuth.java @@ -14,7 +14,9 @@ package org.openapitools.client.auth; import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import java.net.URI; import java.util.Map; import java.util.List; @@ -31,7 +33,8 @@ 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/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..911df8d3a37 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -1,5 +1,6 @@ package org.openapitools.client.auth; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import okhttp3.Interceptor; @@ -18,6 +19,7 @@ import org.apache.oltu.oauth2.common.message.types.GrantType; import java.io.IOException; import java.net.HttpURLConnection; +import java.net.URI; import java.util.Map; import java.util.List; @@ -173,7 +175,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { // Applying authorization to parameters is performed in the retryingIntercept method @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 { // No implementation necessary } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb0175c213..1b5a3cd2239 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 90e9afca2f0..6835e103b62 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f6e70331f6e..3f2f1b3ba82 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0495881506d..21db6cb109f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -77,6 +77,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 208dfdbc15f..c90f346b182 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b008b847a7e..b9a1d371fd3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c2ce3b2fbe2..a61d030c6c0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcecf6e69dd..4745fed6651 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 ee3cf38a18a..24f916d3add 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 @@ -40,7 +40,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7e3ba8195c7..8c7d7694734 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 279edaea8a7..2408d257708 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java index b1bfac1da86..1c7469d68e0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -44,6 +44,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java index ee503f76942..37b2bb735b9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java @@ -86,7 +86,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a6bdb2bbe3f..8334448ffdf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -84,6 +84,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java index 42909659d9c..a99f3586985 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,6 +53,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index 19705043a2f..b226ce008f2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java index 6be8b4534b1..39c740ffe3f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index fdbddf336d3..9d7c0e4a1cd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -37,6 +37,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java index f43b881b90c..eb1d43e00eb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java index 1702dbadd88..8e5e1694ace 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index 5c80057e78e..d4935b3df27 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java index 9e311a1f6af..b1f42a5f620 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java index 9a9c2f1a59a..2b249f35495 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -133,6 +133,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 47007ec6f1b..55ddcb829be 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -242,6 +242,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a6c4008d1e9..d3feb88b1a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,6 +39,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index af715329445..52900682b0f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,6 +90,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7f915754ffa..b8194dc1df6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,6 +37,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index f8fedfcde0c..cc0b38f6c4d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -95,6 +95,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0c225d1f6cd..1c705d4b1ee 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,6 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java index f11d9e5d570..46150911764 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 595d829ad8d..93e9feb5b86 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,6 +41,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java index dc27972cb67..4c0e74f87eb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java index c6fd4106f2b..a0bd099370d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java @@ -46,6 +46,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java index 172856aaf7a..46830867289 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index 34b170e3ecd..530f0eefd41 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -103,6 +103,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index 32829a45215..d8c60dcf97a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,6 +42,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index 8b0094ed608..1c1c47105f9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -108,6 +108,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 23ca124c518..e452bf03a01 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,6 +37,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java index ffd53c78dee..271e41f8323 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index f34a659e794..181b1e65048 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -37,6 +37,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ed5494ea76b..f9fdaf50fe4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,6 +52,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2fd9419115d..a19d60e9022 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -56,6 +56,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java index 86d4751120a..166fea9628c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java @@ -61,6 +61,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java index a09ec289d51..197aac987bc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -148,6 +148,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java index 626901593bd..9edd0ae7bed 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java @@ -1,17 +1,12 @@ package org.openapitools.client; -import okhttp3.OkHttpClient; -import org.openapitools.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.TimeZone; - -import org.junit.*; -import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; +import java.util.*; +import okhttp3.OkHttpClient; +import org.junit.*; +import org.openapitools.client.auth.*; public class ApiClientTest { ApiClient apiClient; @@ -54,16 +49,16 @@ public class ApiClientTest { String[] accepts = {"application/json", "application/xml"}; assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + accepts = new String[] {"APPLICATION/XML", "APPLICATION/JSON"}; assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + accepts = new String[] {"application/xml", "application/json; charset=UTF8"}; assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - accepts = new String[]{"text/plain", "application/xml"}; + accepts = new String[] {"text/plain", "application/xml"}; assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - accepts = new String[]{}; + accepts = new String[] {}; assertNull(apiClient.selectHeaderAccept(accepts)); } @@ -72,17 +67,18 @@ public class ApiClientTest { String[] contentTypes = {"application/json", "application/xml"}; assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + contentTypes = new String[] {"APPLICATION/JSON", "APPLICATION/XML"}; assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + contentTypes = new String[] {"application/xml", "application/json; charset=UTF8"}; + assertEquals( + "application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - contentTypes = new String[]{"text/plain", "application/xml"}; + contentTypes = new String[] {"text/plain", "application/xml"}; assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + contentTypes = new String[] {}; + assertNull(apiClient.selectHeaderContentType(contentTypes)); } @Test @@ -293,7 +289,9 @@ public class ApiClientTest { List multiPairs = apiClient.parameterToPairs("multi", name, values); assertEquals(values.size(), multiPairs.size()); for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); + assertEquals( + apiClient.escapeString(apiClient.parameterToString(values.get(i))), + multiPairs.get(i).getValue()); } // all other formats @@ -312,7 +310,9 @@ public class ApiClientTest { // must equal input values assertEquals(values.size(), pairValueSplit.length); for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); + assertEquals( + apiClient.escapeString(apiClient.parameterToString(values.get(i))), + pairValueSplit[i]); } } } @@ -337,9 +337,7 @@ public class ApiClientTest { assertThat(apiClient.getHttpClient(), is(not(oldClient))); } - /** - * Tests the invariant that the HttpClient for the ApiClient must never be null - */ + /** Tests the invariant that the HttpClient for the ApiClient must never be null */ @Test(expected = NullPointerException.class) public void testNullHttpClient() { apiClient.setHttpClient(null); diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java index f05c230dc75..3d6ab82bd3e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -1,8 +1,8 @@ package org.openapitools.client; -import org.junit.*; import static org.junit.Assert.*; +import org.junit.*; public class ConfigurationTest { @Test diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java index 1c825e39256..9e6dad1a190 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -1,10 +1,8 @@ package org.openapitools.client; +import static org.junit.Assert.*; + import com.google.gson.reflect.TypeToken; - -import org.openapitools.client.model.Order; - -import java.lang.Exception; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -14,17 +12,15 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; - import okio.ByteString; import org.junit.*; +import org.openapitools.client.model.Order; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.ZoneId; import org.threeten.bp.ZoneOffset; import org.threeten.bp.format.DateTimeFormatter; -import static org.junit.Assert.*; - public class JSONTest { private ApiClient apiClient = null; private JSON json = null; @@ -44,13 +40,20 @@ public class JSONTest { assertEquals(str, json.serialize(date)); assertEquals(json.deserialize(str, java.sql.Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString()); + assertEquals( + json.deserialize( + "\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", + java.sql.Date.class) + .toString(), + date.toString()); // custom date format: without day DateFormat format = new SimpleDateFormat("yyyy-MM", Locale.ROOT); apiClient.setSqlDateFormat(format); String dateStr = "\"2015-11\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); } @@ -85,9 +88,14 @@ public class JSONTest { apiClient.setDateFormat(format); String dateStr = "\"2015-11-07T13:49:09+10:00\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); + assertEquals( + dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); try { // invalid time zone format @@ -103,16 +111,16 @@ public class JSONTest { } catch (RuntimeException e) { // OK } - } @Test public void testOffsetDateTimeTypeAdapter() { final String str = "\"2016-09-09T08:02:03.123-03:00\""; - OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); + OffsetDateTime date = + OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); assertEquals(str, json.serialize(date)); - //Use toString() instead of isEqual to verify that the offset is preserved + // Use toString() instead of isEqual to verify that the offset is preserved assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); } @@ -125,7 +133,6 @@ public class JSONTest { assertEquals(json.deserialize(str, LocalDate.class), date); } - @Test public void testDefaultDate() throws Exception { final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; @@ -133,19 +140,20 @@ public class JSONTest { order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); + Type type = new TypeToken() {}.getType(); Order o = json.deserialize(str, type); assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); } @Test public void testCustomDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final DateTimeFormatter datetimeFormat = + DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); final String dateStr = "2015-11-07T14:11:05-02:00"; order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); + Type type = new TypeToken() {}.getType(); Order o = json.deserialize(str, type); assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); } @@ -160,7 +168,8 @@ public class JSONTest { String serializedBytesWithQuotes = json.serialize(expectedBytes); // Assert - String serializedBytes = serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); + String serializedBytes = + serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); if (json.getGson().htmlSafe()) { serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); } @@ -177,16 +186,18 @@ public class JSONTest { final ByteString expectedByteString = ByteString.of(expectedBytes); final String serializedBytes = expectedByteString.base64(); final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; - Type type = new TypeToken() { }.getType(); + Type type = new TypeToken() {}.getType(); // Act byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); // Assert - assertEquals(expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); + assertEquals( + expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); } - // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft https://stackoverflow.com/questions/11399491/java-timezone-offset + // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft + // https://stackoverflow.com/questions/11399491/java-timezone-offset // Direct link https://stackoverflow.com/a/16680815/3166133 public static String getCurrentTimezoneOffset() { @@ -194,9 +205,14 @@ public class JSONTest { Calendar cal = GregorianCalendar.getInstance(tz, Locale.ROOT); int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); - String offset = String.format(Locale.ROOT,"%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60)); + String offset = + String.format( + Locale.ROOT, + "%02d:%02d", + Math.abs(offsetInMillis / 3600000), + Math.abs((offsetInMillis / 60000) % 60)); offset = (offsetInMillis >= 0 ? "+" : "-") + offset; return offset; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java index aa7c81759ec..f6b87fbaaa1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java @@ -1,21 +1,21 @@ package org.openapitools.client; -import org.junit.*; import static org.junit.Assert.*; +import org.junit.*; public class StringUtilTest { @Test public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, null)); - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + assertFalse(StringUtil.containsIgnoreCase(new String[] {"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[] {}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[] {}, null)); } @Test @@ -27,7 +27,7 @@ public class StringUtilTest { assertEquals("aa bb cc", StringUtil.join(array, " ")); assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + assertEquals("", StringUtil.join(new String[] {}, ",")); + assertEquals("abc", StringUtil.join(new String[] {"abc"}, ",")); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 719300bc985..af8a9594410 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -3,42 +3,33 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class 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.Ignore; +import org.junit.Test; 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 - */ +/** 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 + *

To test special tags and operation ID starting with number * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void call123testSpecialTagsTest() throws ApiException { @@ -47,5 +38,4 @@ public class AnotherFakeApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 68036a2ef42..e27079ca0c6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -3,50 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class 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 java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; 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 org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeApi - */ +/** API tests for FakeApi */ @Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); - /** * creates an XmlItem * - * this route creates an XmlItem + *

this route creates an XmlItem * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createXmlItemTest() throws ApiException { @@ -55,14 +48,11 @@ public class FakeApiTest { // TODO: test validations } - + /** - * - * * Test serialization of outer boolean types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { @@ -71,14 +61,11 @@ public class FakeApiTest { // TODO: test validations } - + /** - * - * * Test serialization of object with outer number type * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { @@ -87,14 +74,11 @@ public class FakeApiTest { // TODO: test validations } - + /** - * - * * Test serialization of outer number types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { @@ -103,14 +87,11 @@ public class FakeApiTest { // TODO: test validations } - + /** - * - * * Test serialization of outer string types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterStringSerializeTest() throws ApiException { @@ -119,14 +100,11 @@ public class FakeApiTest { // TODO: test validations } - + /** - * - * * For this test, the body for this request much reference a schema named `File`. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testBodyWithFileSchemaTest() throws ApiException { @@ -135,15 +113,8 @@ public class FakeApiTest { // TODO: test validations } - - /** - * - * - * - * - * @throws ApiException - * if the Api call fails - */ + + /** @throws ApiException if the Api call fails */ @Test public void testBodyWithQueryParamsTest() throws ApiException { String query = null; @@ -152,14 +123,13 @@ public class FakeApiTest { // TODO: test validations } - + /** * To test \"client\" model * - * To test \"client\" model + *

To test \"client\" model * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testClientModelTest() throws ApiException { @@ -168,14 +138,13 @@ public class FakeApiTest { // TODO: test validations } - + /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testEndpointParametersTest() throws ApiException { @@ -193,18 +162,31 @@ public class FakeApiTest { 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); + 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 + *

To test enum parameters * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testEnumParametersTest() throws ApiException { @@ -216,18 +198,25 @@ public class FakeApiTest { Double enumQueryDouble = null; List enumFormStringArray = null; String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + 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) + *

Fake endpoint to test group parameters (optional) * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testGroupParametersTest() throws ApiException { @@ -245,14 +234,11 @@ public class FakeApiTest { // TODO: test validations } - + /** * test inline additionalProperties * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { @@ -261,14 +247,11 @@ public class FakeApiTest { // TODO: test validations } - + /** * test json serialization of form data * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testJsonFormDataTest() throws ApiException { @@ -278,5 +261,4 @@ public class FakeApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 72c85cd045f..16b1c5afa71 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -3,42 +3,33 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class 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.Ignore; +import org.junit.Test; 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 - */ +/** 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 + *

To test class name in snake case * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testClassnameTest() throws ApiException { @@ -47,5 +38,4 @@ public class FakeClassnameTags123ApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java index f65184b608c..47f8fed5c86 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -10,45 +10,41 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Pet; -import org.openapitools.client.auth.*; -import org.openapitools.client.model.*; -import org.openapitools.client.*; +import static org.junit.Assert.*; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; import java.lang.reflect.Type; -import java.util.Arrays; import java.util.ArrayList; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadLocalRandom; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; +import java.util.concurrent.TimeUnit; +import org.junit.*; +import org.openapitools.client.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.model.Pet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.junit.*; - -import static org.junit.Assert.*; - -/** - * API tests for PetApi - */ +/** API tests for PetApi */ public class PetApiTest { private PetApi api = new PetApi(); private final Logger LOG = LoggerFactory.getLogger(PetApiTest.class); - // In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io to 127.0.0.1 + // In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io + // to 127.0.0.1 private static String basePath = "http://petstore.swagger.io:80/v2"; @Before @@ -118,27 +114,35 @@ public class PetApiTest { // to store returned Pet or error message/exception final Map result = new HashMap(); - api.getPetByIdAsync(pet.getId(), new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("error", e.getMessage()); - } + api.getPetByIdAsync( + pet.getId(), + new ApiCallback() { + @Override + public void onFailure( + ApiException e, + int statusCode, + Map> responseHeaders) { + result.put("error", e.getMessage()); + } - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } + @Override + public void onSuccess( + Pet pet, int statusCode, Map> responseHeaders) { + result.put("pet", pet); + } - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } + @Override + public void onUploadProgress( + long bytesWritten, long contentLength, boolean done) { + // empty + } - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); + @Override + public void onDownloadProgress( + long bytesRead, long contentLength, boolean done) { + // empty + } + }); // wait for the asynchronous call to finish (at most 10 seconds) final int maxTry = 10; @@ -167,27 +171,35 @@ public class PetApiTest { // test getting a nonexistent pet result.clear(); - api.getPetByIdAsync(-10000L, new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("exception", e); - } + api.getPetByIdAsync( + -10000L, + new ApiCallback() { + @Override + public void onFailure( + ApiException e, + int statusCode, + Map> responseHeaders) { + result.put("exception", e); + } - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } + @Override + public void onSuccess( + Pet pet, int statusCode, Map> responseHeaders) { + result.put("pet", pet); + } - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } + @Override + public void onUploadProgress( + long bytesWritten, long contentLength, boolean done) { + // empty + } - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); + @Override + public void onDownloadProgress( + long bytesRead, long contentLength, boolean done) { + // empty + } + }); // wait for the asynchronous call to finish (at most 10 seconds) final int maxTry = 10; @@ -272,7 +284,6 @@ public class PetApiTest { api.deletePet(pet2.getId(), null); } - @Test public void testUpdatePet() throws Exception { Pet pet = createPet(); @@ -398,7 +409,8 @@ public class PetApiTest { assertTrue(pet1.hashCode() == pet1.hashCode()); pet2.setName("really-happy"); - pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + pet2.setPhotoUrls( + new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertFalse(pet1.equals(pet2)); assertFalse(pet2.equals(pet1)); assertFalse(pet1.hashCode() == (pet2.hashCode())); @@ -406,7 +418,8 @@ public class PetApiTest { assertTrue(pet2.hashCode() == pet2.hashCode()); pet1.setName("really-happy"); - pet1.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + pet1.setPhotoUrls( + new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertTrue(pet1.equals(pet2)); assertTrue(pet2.equals(pet1)); assertTrue(pet1.hashCode() == pet2.hashCode()); @@ -414,7 +427,6 @@ public class PetApiTest { assertTrue(pet1.hashCode() == pet1.hashCode()); } - private Pet createPet() { Pet pet = new Pet(); pet.setId(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)); @@ -425,7 +437,8 @@ public class PetApiTest { pet.setCategory(category); pet.setStatus(Pet.StatusEnum.AVAILABLE); - Set photos = new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + Set photos = + new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); pet.setPhotoUrls(photos); return pet; @@ -443,17 +456,14 @@ public class PetApiTest { assertNotNull(actual); assertEquals(expected.getId(), actual.getId()); assertNotNull(actual.getCategory()); - assertEquals(expected.getCategory().getName(), - actual.getCategory().getName()); + assertEquals(expected.getCategory().getName(), actual.getCategory().getName()); } /** - * Assert that the given upload/download progress list satisfies the - * following constraints: - *

- * - List is not empty - * - Byte count should be nondecreasing - * - The last element, and only the last element, should have done=true + * Assert that the given upload/download progress list satisfies the following constraints: + * + *

- List is not empty - Byte count should be nondecreasing - The last element, and only the + * last element, should have done=true */ private void assertValidProgress(List progressList) { assertFalse(progressList.isEmpty()); @@ -463,8 +473,7 @@ public class PetApiTest { for (Progress progress : progressList) { if (prev != null) { if (prev.done || prev.bytes > progress.bytes) { - fail("Progress list out of order at index " + index - + ": " + progressList); + fail("Progress list out of order at index " + index + ": " + progressList); } } prev = progress; @@ -495,7 +504,8 @@ public class PetApiTest { } @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + public void onFailure( + ApiException e, int statusCode, Map> responseHeaders) { exception = e; this.done = true; this.success = false; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/StoreApiTest.java index b10e977454f..41c551458ed 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -3,42 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class 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 java.util.Map; +import org.junit.Ignore; +import org.junit.Test; 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 - */ +/** 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 + *

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 + * @throws ApiException if the Api call fails */ @Test public void deleteOrderTest() throws ApiException { @@ -47,14 +40,13 @@ public class StoreApiTest { // TODO: test validations } - + /** * Returns pet inventories by status * - * Returns a map of status codes to quantities + *

Returns a map of status codes to quantities * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getInventoryTest() throws ApiException { @@ -62,14 +54,14 @@ public class StoreApiTest { // TODO: test validations } - + /** * Find purchase order by ID * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + *

For valid response try integer IDs with value <= 5 or > 10. Other values will + * generated exceptions * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getOrderByIdTest() throws ApiException { @@ -78,14 +70,11 @@ public class StoreApiTest { // TODO: test validations } - + /** * Place an order for a pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void placeOrderTest() throws ApiException { @@ -94,5 +83,4 @@ public class StoreApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/UserApiTest.java index 7c392f77f99..364b90cab31 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -3,42 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class 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 java.util.List; +import org.junit.Ignore; +import org.junit.Test; 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 - */ +/** 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. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUserTest() throws ApiException { @@ -47,14 +39,11 @@ public class UserApiTest { // TODO: test validations } - + /** * Creates list of users with given input array * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUsersWithArrayInputTest() throws ApiException { @@ -63,14 +52,11 @@ public class UserApiTest { // TODO: test validations } - + /** * Creates list of users with given input array * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUsersWithListInputTest() throws ApiException { @@ -79,14 +65,13 @@ public class UserApiTest { // TODO: test validations } - + /** * Delete user * - * This can only be done by the logged in user. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void deleteUserTest() throws ApiException { @@ -95,14 +80,11 @@ public class UserApiTest { // TODO: test validations } - + /** * Get user by user name * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getUserByNameTest() throws ApiException { @@ -111,14 +93,11 @@ public class UserApiTest { // TODO: test validations } - + /** * Logs user into the system * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void loginUserTest() throws ApiException { @@ -128,14 +107,11 @@ public class UserApiTest { // TODO: test validations } - + /** * Logs out current logged in user session * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void logoutUserTest() throws ApiException { @@ -143,14 +119,13 @@ public class UserApiTest { // TODO: test validations } - + /** * Updated user * - * This can only be done by the logged in user. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updateUserTest() throws ApiException { @@ -160,5 +135,4 @@ public class UserApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java index da25043b27e..f7c2ecec9e1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -1,25 +1,25 @@ package org.openapitools.client.auth; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class ApiKeyAuthTest { @Test - public void testApplyToParamsInQuery() { + public void testApplyToParamsInQuery() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); assertEquals(1, queryParams.size()); for (Pair queryParam : queryParams) { @@ -32,14 +32,14 @@ public class ApiKeyAuthTest { } @Test - public void testApplyToParamsInQueryWithNullValue() { + public void testApplyToParamsInQueryWithNullValue() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); auth.setApiKey(null); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to parameters assertEquals(0, queryParams.size()); @@ -48,7 +48,7 @@ public class ApiKeyAuthTest { } @Test - public void testApplyToParamsInHeaderWithPrefix() { + public void testApplyToParamsInHeaderWithPrefix() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); @@ -56,7 +56,7 @@ public class ApiKeyAuthTest { ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); auth.setApiKey("my-api-token"); auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to query or cookie parameters assertEquals(0, queryParams.size()); @@ -66,7 +66,7 @@ public class ApiKeyAuthTest { } @Test - public void testApplyToParamsInHeaderWithNullValue() { + public void testApplyToParamsInHeaderWithNullValue() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); @@ -74,7 +74,7 @@ public class ApiKeyAuthTest { ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); auth.setApiKey(null); auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to parameters assertEquals(0, queryParams.size()); @@ -83,7 +83,7 @@ public class ApiKeyAuthTest { } @Test - public void testApplyToParamsInCookieWithPrefix() { + public void testApplyToParamsInCookieWithPrefix() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); @@ -91,7 +91,7 @@ public class ApiKeyAuthTest { ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); auth.setApiKey("my-api-token"); auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to query or header parameters assertEquals(0, queryParams.size()); @@ -101,7 +101,7 @@ public class ApiKeyAuthTest { } @Test - public void testApplyToParamsInCookieWithNullValue() { + public void testApplyToParamsInCookieWithNullValue() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); @@ -109,7 +109,7 @@ public class ApiKeyAuthTest { ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); auth.setApiKey(null); auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to parameters assertEquals(0, queryParams.size()); diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java index e963ea24f7f..a077d394ada 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -1,14 +1,14 @@ package org.openapitools.client.auth; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class HttpBasicAuthTest { HttpBasicAuth auth = null; @@ -19,26 +19,27 @@ public class HttpBasicAuthTest { } @Test - public void testApplyToParams() { + public void testApplyToParams() throws ApiException { List queryParams = new ArrayList(); Map headerParams = new HashMap(); Map cookieParams = new HashMap(); auth.setUsername("my-username"); auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to query or cookie parameters assertEquals(0, queryParams.size()); assertEquals(0, cookieParams.size()); assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " + // prefix String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; assertEquals(expected, headerParams.get("Authorization")); // null username should be treated as empty string auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // the string below is base64-encoded result of ":my-password" with the "Basic " prefix expected = "Basic Om15LXBhc3N3b3Jk"; assertEquals(expected, headerParams.get("Authorization")); @@ -46,7 +47,7 @@ public class HttpBasicAuthTest { // null password should be treated as empty string auth.setUsername("my-username"); auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // the string below is base64-encoded result of "my-username:" with the "Basic " prefix expected = "Basic bXktdXNlcm5hbWU6"; assertEquals(expected, headerParams.get("Authorization")); @@ -56,7 +57,7 @@ public class HttpBasicAuthTest { headerParams = new HashMap(); auth.setUsername(null); auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); // no changes to parameters assertEquals(0, queryParams.size()); assertEquals(0, headerParams.size()); diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java index dca9b7c69ea..7e0b2bec4b5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java @@ -1,7 +1,19 @@ package org.openapitools.client.auth; -import okhttp3.Interceptor.Chain; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.Collections; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; import okhttp3.*; +import okhttp3.Interceptor.Chain; import okhttp3.Response.Builder; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.oltu.oauth2.client.OAuthClient; @@ -14,27 +26,19 @@ import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Collections; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - public class RetryingOAuthTest { private RetryingOAuth oauth; @Before public void setUp() throws Exception { - oauth = new RetryingOAuth("_clientId", "_clientSecret", OAuthFlow.accessCode, - "https://token.example.com", Collections.emptyMap()); + oauth = + new RetryingOAuth( + "_clientId", + "_clientSecret", + OAuthFlow.accessCode, + "https://token.example.com", + Collections.emptyMap()); oauth.setAccessToken("expired-access-token"); FieldUtils.writeField(oauth, "oAuthClient", mockOAuthClient(), true); } @@ -48,12 +52,13 @@ public class RetryingOAuthTest { @Test public void testTwoConcurrentRequestsUnauthorized() throws Exception { - Callable callable = new Callable() { - @Override - public Response call() throws Exception { - return oauth.intercept(mockChain()); - } - }; + Callable callable = + new Callable() { + @Override + public Response call() throws Exception { + return oauth.intercept(mockChain()); + } + }; ExecutorService executor = Executors.newFixedThreadPool(2); try { Future response1 = executor.submit(callable); @@ -68,14 +73,16 @@ public class RetryingOAuthTest { private OAuthClient mockOAuthClient() throws OAuthProblemException, OAuthSystemException { OAuthJSONAccessTokenResponse response = mock(OAuthJSONAccessTokenResponse.class); - when(response.getAccessToken()).thenAnswer(new Answer() { - @Override - public String answer(InvocationOnMock invocation) throws Throwable { - // sleep ensures that the bug is triggered. - Thread.sleep(1000); - return "new-access-token"; - } - }); + when(response.getAccessToken()) + .thenAnswer( + new Answer() { + @Override + public String answer(InvocationOnMock invocation) throws Throwable { + // sleep ensures that the bug is triggered. + Thread.sleep(1000); + return "new-access-token"; + } + }); OAuthClient client = mock(OAuthClient.class); when(client.accessToken(any(OAuthClientRequest.class))).thenReturn(response); @@ -85,27 +92,31 @@ public class RetryingOAuthTest { private Chain mockChain() throws IOException { Chain chain = mock(Chain.class); - final Request request = new Request.Builder() - .url("https://api.example.com") - .build(); + final Request request = new Request.Builder().url("https://api.example.com").build(); when(chain.request()).thenReturn(request); - when(chain.proceed(any(Request.class))).thenAnswer(new Answer() { - @Override - public Response answer(InvocationOnMock inv) { - Request r = inv.getArgument(0); - int responseCode = "Bearer new-access-token".equals(r.header("Authorization")) - ? HttpURLConnection.HTTP_OK - : HttpURLConnection.HTTP_UNAUTHORIZED; - return new Builder() - .protocol(Protocol.HTTP_1_0) - .message("sup") - .request(request) - .body(ResponseBody.create(new byte[0], MediaType.get("application/test"))) - .code(responseCode) - .build(); - } - }); + when(chain.proceed(any(Request.class))) + .thenAnswer( + new Answer() { + @Override + public Response answer(InvocationOnMock inv) { + Request r = inv.getArgument(0); + int responseCode = + "Bearer new-access-token".equals(r.header("Authorization")) + ? HttpURLConnection.HTTP_OK + : HttpURLConnection.HTTP_UNAUTHORIZED; + return new Builder() + .protocol(Protocol.HTTP_1_0) + .message("sup") + .request(request) + .body( + ResponseBody.create( + new byte[0], + MediaType.get("application/test"))) + .code(responseCode) + .build(); + } + }); return chain; } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 656f0577161..430462cf43b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -3,51 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesAnyType - */ +/** Model tests for AdditionalPropertiesAnyType */ public class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); - /** - * Model tests for AdditionalPropertiesAnyType - */ + /** Model tests for AdditionalPropertiesAnyType */ @Test public void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 4c5bdc4ffad..b9d65fe3eea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -3,52 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for AdditionalPropertiesArray */ public class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); - /** - * Model tests for AdditionalPropertiesArray - */ + /** Model tests for AdditionalPropertiesArray */ @Test public void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index de976999c63..b06e5479b6b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -3,51 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesBoolean - */ +/** Model tests for AdditionalPropertiesBoolean */ public class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); - /** - * Model tests for AdditionalPropertiesBoolean - */ + /** Model tests for AdditionalPropertiesBoolean */ @Test public void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3c18ad38c7e..88d7524b60e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -3,60 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for AdditionalPropertiesClass - */ + /** Model tests for AdditionalPropertiesClass */ @Test public void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } - /** - * Test the property 'mapProperty' - */ + /** Test the property 'mapProperty' */ @Test public void mapPropertyTest() { // TODO: test mapProperty } - /** - * Test the property 'mapOfMapProperty' - */ + /** Test the property 'mapOfMapProperty' */ @Test public void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 712e0c131b1..32c1059ad2a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -3,51 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesInteger - */ +/** Model tests for AdditionalPropertiesInteger */ public class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); - /** - * Model tests for AdditionalPropertiesInteger - */ + /** Model tests for AdditionalPropertiesInteger */ @Test public void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index a2039fa83a5..e6a7397cd47 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -3,52 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for AdditionalPropertiesNumber */ public class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); - /** - * Model tests for AdditionalPropertiesNumber - */ + /** Model tests for AdditionalPropertiesNumber */ @Test public void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3c9fe9323b8..d4a8e5ccbd5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -3,51 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesObject - */ +/** Model tests for AdditionalPropertiesObject */ public class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); - /** - * Model tests for AdditionalPropertiesObject - */ + /** Model tests for AdditionalPropertiesObject */ @Test public void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3a3942ab84d..7fbf7373e79 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -3,51 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesString - */ +/** Model tests for AdditionalPropertiesString */ public class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); - /** - * Model tests for AdditionalPropertiesString - */ + /** Model tests for AdditionalPropertiesString */ @Test public void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java index 30ed464f5e1..3fc1aa69d6d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Animal - */ + /** Model tests for Animal */ @Test public void testAnimal() { // TODO: test Animal } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 27121aec515..8760f56d594 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -3,49 +3,33 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.apache.commons.lang3.builder.EqualsBuilder; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; + 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(); - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ + /** Model tests for ArrayOfArrayOfNumberOnly */ @Test public void test() { // TODO: test ArrayOfArrayOfNumberOnly } - /** - * Test the property 'arrayArrayNumber' - */ + /** Test the property 'arrayArrayNumber' */ @Test public void arrayArrayNumberTest() { BigDecimal b1 = new BigDecimal("12.3"); @@ -68,5 +52,4 @@ public class ArrayOfArrayOfNumberOnlyTest { Assert.assertTrue(model2.equals(model)); } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 2f88d6ad4b9..943881b40a6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -3,52 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ArrayOfNumberOnly - */ + /** Model tests for ArrayOfNumberOnly */ @Test public void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } - /** - * Test the property 'arrayNumber' - */ + /** Test the property 'arrayNumber' */ @Test public void arrayNumberTest() { // TODO: test arrayNumber } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 3182aa65481..8aa245e54fb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -3,68 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ArrayTest - */ + /** Model tests for ArrayTest */ @Test public void testArrayTest() { // TODO: test ArrayTest } - /** - * Test the property 'arrayOfString' - */ + /** Test the property 'arrayOfString' */ @Test public void arrayOfStringTest() { // TODO: test arrayOfString } - /** - * Test the property 'arrayArrayOfInteger' - */ + /** Test the property 'arrayArrayOfInteger' */ @Test public void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } - /** - * Test the property 'arrayArrayOfModel' - */ + /** Test the property 'arrayArrayOfModel' */ @Test public void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java index f7f725106d1..256f7087f38 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -3,49 +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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for BigCatAllOf - */ +/** Model tests for BigCatAllOf */ public class BigCatAllOfTest { private final BigCatAllOf model = new BigCatAllOf(); - /** - * Model tests for BigCatAllOf - */ + /** Model tests for BigCatAllOf */ @Test public void testBigCatAllOf() { // TODO: test BigCatAllOf } - /** - * Test the property 'kind' - */ + /** Test the property 'kind' */ @Test public void kindTest() { // TODO: test kind } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java index 0cb50249725..4591ecd4d6a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -3,75 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for BigCat */ public class BigCatTest { private final BigCat model = new BigCat(); - /** - * Model tests for BigCat - */ + /** Model tests for BigCat */ @Test public void testBigCat() { // TODO: test BigCat } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - /** - * Test the property 'declawed' - */ + /** Test the property 'declawed' */ @Test public void declawedTest() { // TODO: test declawed } - /** - * Test the property 'kind' - */ + /** Test the property 'kind' */ @Test public void kindTest() { // TODO: test kind } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 1d029ba7c50..d4e6c28023c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -3,89 +3,61 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Capitalization - */ + /** Model tests for Capitalization */ @Test public void testCapitalization() { // TODO: test Capitalization } - /** - * Test the property 'smallCamel' - */ + /** Test the property 'smallCamel' */ @Test public void smallCamelTest() { // TODO: test smallCamel } - /** - * Test the property 'capitalCamel' - */ + /** Test the property 'capitalCamel' */ @Test public void capitalCamelTest() { // TODO: test capitalCamel } - /** - * Test the property 'smallSnake' - */ + /** Test the property 'smallSnake' */ @Test public void smallSnakeTest() { // TODO: test smallSnake } - /** - * Test the property 'capitalSnake' - */ + /** Test the property 'capitalSnake' */ @Test public void capitalSnakeTest() { // TODO: test capitalSnake } - /** - * Test the property 'scAETHFlowPoints' - */ + /** Test the property 'scAETHFlowPoints' */ @Test public void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } - /** - * Test the property 'ATT_NAME' - */ + /** Test the property 'ATT_NAME' */ @Test public void ATT_NAMETest() { // TODO: test ATT_NAME } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java index 0473dc929e5..ce9fa9c4663 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for CatAllOf - */ + /** Model tests for CatAllOf */ @Test public void testCatAllOf() { // TODO: test CatAllOf } - /** - * Test the property 'declawed' - */ + /** Test the property 'declawed' */ @Test public void declawedTest() { // TODO: test declawed } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java index 718bb5b6baf..41fc819a99b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java @@ -3,66 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -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(); - /** - * Model tests for Cat - */ + /** Model tests for Cat */ @Test public void testCat() { // TODO: test Cat } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - /** - * Test the property 'declawed' - */ + /** Test the property 'declawed' */ @Test public void declawedTest() { // TODO: test declawed } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java index 79374c54e6f..37048d7a861 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Category - */ + /** Model tests for Category */ @Test public void testCategory() { // TODO: test Category } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java index 4c66db89c4f..bb4bfead7f9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ClassModel - */ + /** Model tests for ClassModel */ @Test public void testClassModel() { // TODO: test ClassModel } - /** - * Test the property 'propertyClass' - */ + /** Test the property 'propertyClass' */ @Test public void propertyClassTest() { // TODO: test propertyClass } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java index 1a9f6d6fc9e..ebc46fd2c49 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Client - */ + /** Model tests for Client */ @Test public void testClient() { // TODO: test Client } - /** - * Test the property 'client' - */ + /** Test the property 'client' */ @Test public void clientTest() { // TODO: test client } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java index 7780c14a386..5c7775454c0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for DogAllOf - */ + /** Model tests for DogAllOf */ @Test public void testDogAllOf() { // TODO: test DogAllOf } - /** - * Test the property 'breed' - */ + /** Test the property 'breed' */ @Test public void breedTest() { // TODO: test breed } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java index 8392c174564..4c0e461bc95 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java @@ -3,66 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -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(); - /** - * Model tests for Dog - */ + /** Model tests for Dog */ @Test public void testDog() { // TODO: test Dog } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - /** - * Test the property 'breed' - */ + /** Test the property 'breed' */ @Test public void breedTest() { // TODO: test breed } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java index a116bb028fc..b9201504fbe 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -3,59 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for EnumArrays - */ + /** Model tests for EnumArrays */ @Test public void testEnumArrays() { // TODO: test EnumArrays } - /** - * Test the property 'justSymbol' - */ + /** Test the property 'justSymbol' */ @Test public void justSymbolTest() { // TODO: test justSymbol } - /** - * Test the property 'arrayEnum' - */ + /** Test the property 'arrayEnum' */ @Test public void arrayEnumTest() { // TODO: test arrayEnum } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java index 97855ba723a..e2b56f33f9f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -3,32 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.annotations.SerializedName; -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 - */ + /** Model tests for EnumClass */ @Test public void testEnumClass() { // TODO: test EnumClass } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java index d43e3cace6d..2bced4c6fdc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -3,82 +3,55 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for EnumTest - */ + /** Model tests for EnumTest */ @Test public void testEnumTest() { // TODO: test EnumTest } - /** - * Test the property 'enumString' - */ + /** Test the property 'enumString' */ @Test public void enumStringTest() { // TODO: test enumString } - /** - * Test the property 'enumStringRequired' - */ + /** Test the property 'enumStringRequired' */ @Test public void enumStringRequiredTest() { // TODO: test enumStringRequired } - /** - * Test the property 'enumInteger' - */ + /** Test the property 'enumInteger' */ @Test public void enumIntegerTest() { // TODO: test enumInteger } - /** - * Test the property 'enumNumber' - */ + /** Test the property 'enumNumber' */ @Test public void enumNumberTest() { // TODO: test enumNumber } - /** - * Test the property 'outerEnum' - */ + /** Test the property 'outerEnum' */ @Test public void outerEnumTest() { // TODO: test outerEnum } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java index 73440e547b2..c69c54780f8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -1,12 +1,11 @@ package org.openapitools.client.model; -import org.junit.Test; - -import com.google.gson.Gson; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.google.gson.Gson; +import org.junit.Test; + public class EnumValueTest { @Test diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a960673c616..0f7eba90234 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -3,59 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for FileSchemaTestClass - */ + /** Model tests for FileSchemaTestClass */ @Test public void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } - /** - * Test the property 'file' - */ + /** Test the property 'file' */ @Test public void fileTest() { // TODO: test file } - /** - * Test the property 'files' - */ + /** Test the property 'files' */ @Test public void filesTest() { // TODO: test files } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java index 4d5b377c0b4..e96ca5285a3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -3,150 +3,103 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.io.IOException; -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(); - /** - * Model tests for FormatTest - */ + /** Model tests for FormatTest */ @Test public void testFormatTest() { // TODO: test FormatTest } - /** - * Test the property 'integer' - */ + /** Test the property 'integer' */ @Test public void integerTest() { // TODO: test integer } - /** - * Test the property 'int32' - */ + /** Test the property 'int32' */ @Test public void int32Test() { // TODO: test int32 } - /** - * Test the property 'int64' - */ + /** Test the property 'int64' */ @Test public void int64Test() { // TODO: test int64 } - /** - * Test the property 'number' - */ + /** Test the property 'number' */ @Test public void numberTest() { // TODO: test number } - /** - * Test the property '_float' - */ + /** Test the property '_float' */ @Test public void _floatTest() { // TODO: test _float } - /** - * Test the property '_double' - */ + /** Test the property '_double' */ @Test public void _doubleTest() { // TODO: test _double } - /** - * Test the property 'string' - */ + /** Test the property 'string' */ @Test public void stringTest() { // TODO: test string } - /** - * Test the property '_byte' - */ + /** Test the property '_byte' */ @Test public void _byteTest() { // TODO: test _byte } - /** - * Test the property 'binary' - */ + /** Test the property 'binary' */ @Test public void binaryTest() { // TODO: test binary } - /** - * Test the property 'date' - */ + /** Test the property 'date' */ @Test public void dateTest() { // TODO: test date } - /** - * Test the property 'dateTime' - */ + /** Test the property 'dateTime' */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** - * Test the property 'uuid' - */ + /** Test the property 'uuid' */ @Test public void uuidTest() { // TODO: test uuid } - /** - * Test the property 'password' - */ + /** Test the property 'password' */ @Test public void passwordTest() { // TODO: test password } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index d854c0c9daf..1befaa708c6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for HasOnlyReadOnly - */ + /** Model tests for HasOnlyReadOnly */ @Test public void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } - /** - * Test the property 'bar' - */ + /** Test the property 'bar' */ @Test public void barTest() { // TODO: test bar } - /** - * Test the property 'foo' - */ + /** Test the property 'foo' */ @Test public void fooTest() { // TODO: test foo } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java index 9f78d486659..9d1fc952d5f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -3,76 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for MapTest - */ + /** Model tests for MapTest */ @Test public void testMapTest() { // TODO: test MapTest } - /** - * Test the property 'mapMapOfString' - */ + /** Test the property 'mapMapOfString' */ @Test public void mapMapOfStringTest() { // TODO: test mapMapOfString } - /** - * Test the property 'mapOfEnumString' - */ + /** Test the property 'mapOfEnumString' */ @Test public void mapOfEnumStringTest() { // TODO: test mapOfEnumString } - /** - * Test the property 'directMap' - */ + /** Test the property 'directMap' */ @Test public void directMapTest() { // TODO: test directMap } - /** - * Test the property 'indirectMap' - */ + /** Test the property 'indirectMap' */ @Test public void indirectMapTest() { // TODO: test indirectMap } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 93829ac8d53..73646592bd5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -3,71 +3,44 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ + /** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test public void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } - /** - * Test the property 'uuid' - */ + /** Test the property 'uuid' */ @Test public void uuidTest() { // TODO: test uuid } - /** - * Test the property 'dateTime' - */ + /** Test the property 'dateTime' */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** - * Test the property 'map' - */ + /** Test the property 'map' */ @Test public void mapTest() { // TODO: test map } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dcea5877334..bea71b18c63 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Model200Response - */ + /** Model tests for Model200Response */ @Test public void testModel200Response() { // TODO: test Model200Response } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'propertyClass' - */ + /** Test the property 'propertyClass' */ @Test public void propertyClassTest() { // TODO: test propertyClass } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 46b8648fdcc..e3b5dd76854 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -3,65 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ModelApiResponse - */ + /** Model tests for ModelApiResponse */ @Test public void testModelApiResponse() { // TODO: test ModelApiResponse } - /** - * Test the property 'code' - */ + /** Test the property 'code' */ @Test public void codeTest() { // TODO: test code } - /** - * Test the property 'type' - */ + /** Test the property 'type' */ @Test public void typeTest() { // TODO: test type } - /** - * Test the property 'message' - */ + /** Test the property 'message' */ @Test public void messageTest() { // TODO: test message } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 4135ead5686..fac09a012c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ModelReturn - */ + /** Model tests for ModelReturn */ @Test public void testModelReturn() { // TODO: test ModelReturn } - /** - * Test the property '_return' - */ + /** Test the property '_return' */ @Test public void _returnTest() { // TODO: test _return } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java index bdc04b000c1..ad86a79a140 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java @@ -3,73 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Name - */ + /** Model tests for Name */ @Test public void testName() { // TODO: test Name } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'snakeCase' - */ + /** Test the property 'snakeCase' */ @Test public void snakeCaseTest() { // TODO: test snakeCase } - /** - * Test the property 'property' - */ + /** Test the property 'property' */ @Test public void propertyTest() { // TODO: test property } - /** - * Test the property '_123number' - */ + /** Test the property '_123number' */ @Test public void _123numberTest() { // TODO: test _123number } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 214a6d4538d..c321b5be963 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -3,50 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for NumberOnly - */ + /** Model tests for NumberOnly */ @Test public void testNumberOnly() { // TODO: test NumberOnly } - /** - * Test the property 'justNumber' - */ + /** Test the property 'justNumber' */ @Test public void justNumberTest() { // TODO: test justNumber } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java index 808e365efb5..d5a62b67857 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -3,90 +3,61 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Order - */ + /** Model tests for Order */ @Test public void testOrder() { // TODO: test Order } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'petId' - */ + /** Test the property 'petId' */ @Test public void petIdTest() { // TODO: test petId } - /** - * Test the property 'quantity' - */ + /** Test the property 'quantity' */ @Test public void quantityTest() { // TODO: test quantity } - /** - * Test the property 'shipDate' - */ + /** Test the property 'shipDate' */ @Test public void shipDateTest() { // TODO: test shipDate } - /** - * Test the property 'status' - */ + /** Test the property 'status' */ @Test public void statusTest() { // TODO: test status } - /** - * Test the property 'complete' - */ + /** Test the property 'complete' */ @Test public void completeTest() { // TODO: test complete } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 710bfedd580..55337798231 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -3,66 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for OuterComposite - */ + /** Model tests for OuterComposite */ @Test public void testOuterComposite() { // TODO: test OuterComposite } - /** - * Test the property 'myNumber' - */ + /** Test the property 'myNumber' */ @Test public void myNumberTest() { // TODO: test myNumber } - /** - * Test the property 'myString' - */ + /** Test the property 'myString' */ @Test public void myStringTest() { // TODO: test myString } - /** - * Test the property 'myBoolean' - */ + /** Test the property 'myBoolean' */ @Test public void myBooleanTest() { // TODO: test myBoolean } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 064f84b3ff6..ff2a09c9cf5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -3,32 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.annotations.SerializedName; -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 - */ + /** Model tests for OuterEnum */ @Test public void testOuterEnum() { // TODO: test OuterEnum } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java index 3f4c1e8365d..1d56dee54d6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java @@ -3,42 +3,24 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Pet - */ + /** Model tests for Pet */ @Test public void testPet() { // test Pet @@ -52,52 +34,39 @@ public class PetTest { Assert.assertTrue(model.equals(model2)); } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'category' - */ + /** Test the property 'category' */ @Test public void categoryTest() { // TODO: test category } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'photoUrls' - */ + /** Test the property 'photoUrls' */ @Test public void photoUrlsTest() { // TODO: test photoUrls } - /** - * Test the property 'tags' - */ + /** Test the property 'tags' */ @Test public void tagsTest() { // TODO: test tags } - /** - * Test the property 'status' - */ + /** Test the property 'status' */ @Test public void statusTest() { // TODO: test status } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index c89b608f609..06598cf3c01 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for ReadOnlyFirst - */ + /** Model tests for ReadOnlyFirst */ @Test public void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } - /** - * Test the property 'bar' - */ + /** Test the property 'bar' */ @Test public void barTest() { // TODO: test bar } - /** - * Test the property 'baz' - */ + /** Test the property 'baz' */ @Test public void bazTest() { // TODO: test baz } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d058c884e49..cf92b840b64 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -3,49 +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: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for SpecialModelName - */ + /** Model tests for SpecialModelName */ @Test public void testSpecialModelName() { // TODO: test SpecialModelName } - /** - * Test the property '$specialPropertyName' - */ + /** Test the property '$specialPropertyName' */ @Test public void $specialPropertyNameTest() { // TODO: test $specialPropertyName } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java index 27acc7ce8e7..09ab515d40f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for Tag - */ + /** Model tests for Tag */ @Test public void testTag() { // TODO: test Tag } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index f120407395a..499a89a047f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -3,84 +3,55 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for TypeHolderDefault */ public class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); - /** - * Model tests for TypeHolderDefault - */ + /** Model tests for TypeHolderDefault */ @Test public void testTypeHolderDefault() { // TODO: test TypeHolderDefault } - /** - * Test the property 'stringItem' - */ + /** Test the property 'stringItem' */ @Test public void stringItemTest() { // TODO: test stringItem } - /** - * Test the property 'numberItem' - */ + /** Test the property 'numberItem' */ @Test public void numberItemTest() { // TODO: test numberItem } - /** - * Test the property 'integerItem' - */ + /** Test the property 'integerItem' */ @Test public void integerItemTest() { // TODO: test integerItem } - /** - * Test the property 'boolItem' - */ + /** Test the property 'boolItem' */ @Test public void boolItemTest() { // TODO: test boolItem } - /** - * Test the property 'arrayItem' - */ + /** Test the property 'arrayItem' */ @Test public void arrayItemTest() { // TODO: test arrayItem } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5e99dff0cae..cc6e01888bf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -3,84 +3,55 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for TypeHolderExample */ public class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); - /** - * Model tests for TypeHolderExample - */ + /** Model tests for TypeHolderExample */ @Test public void testTypeHolderExample() { // TODO: test TypeHolderExample } - /** - * Test the property 'stringItem' - */ + /** Test the property 'stringItem' */ @Test public void stringItemTest() { // TODO: test stringItem } - /** - * Test the property 'numberItem' - */ + /** Test the property 'numberItem' */ @Test public void numberItemTest() { // TODO: test numberItem } - /** - * Test the property 'integerItem' - */ + /** Test the property 'integerItem' */ @Test public void integerItemTest() { // TODO: test integerItem } - /** - * Test the property 'boolItem' - */ + /** Test the property 'boolItem' */ @Test public void boolItemTest() { // TODO: test boolItem } - /** - * Test the property 'arrayItem' - */ + /** Test the property 'arrayItem' */ @Test public void arrayItemTest() { // TODO: test arrayItem } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java index da1c9bda4b5..b388f3e0a93 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java @@ -3,105 +3,73 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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(); - /** - * Model tests for User - */ + /** Model tests for User */ @Test public void testUser() { // TODO: test User } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'username' - */ + /** Test the property 'username' */ @Test public void usernameTest() { // TODO: test username } - /** - * Test the property 'firstName' - */ + /** Test the property 'firstName' */ @Test public void firstNameTest() { // TODO: test firstName } - /** - * Test the property 'lastName' - */ + /** Test the property 'lastName' */ @Test public void lastNameTest() { // TODO: test lastName } - /** - * Test the property 'email' - */ + /** Test the property 'email' */ @Test public void emailTest() { // TODO: test email } - /** - * Test the property 'password' - */ + /** Test the property 'password' */ @Test public void passwordTest() { // TODO: test password } - /** - * Test the property 'phone' - */ + /** Test the property 'phone' */ @Test public void phoneTest() { // TODO: test phone } - /** - * Test the property 'userStatus' - */ + /** Test the property 'userStatus' */ @Test public void userStatusTest() { // TODO: test userStatus } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java index 7ecbaf4fa98..e8ab601c066 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -3,276 +3,199 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * * NOTE: This class is auto 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.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -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 - */ +/** Model tests for XmlItem */ public class XmlItemTest { private final XmlItem model = new XmlItem(); - /** - * Model tests for XmlItem - */ + /** Model tests for XmlItem */ @Test public void testXmlItem() { // TODO: test XmlItem } - /** - * Test the property 'attributeString' - */ + /** Test the property 'attributeString' */ @Test public void attributeStringTest() { // TODO: test attributeString } - /** - * Test the property 'attributeNumber' - */ + /** Test the property 'attributeNumber' */ @Test public void attributeNumberTest() { // TODO: test attributeNumber } - /** - * Test the property 'attributeInteger' - */ + /** Test the property 'attributeInteger' */ @Test public void attributeIntegerTest() { // TODO: test attributeInteger } - /** - * Test the property 'attributeBoolean' - */ + /** Test the property 'attributeBoolean' */ @Test public void attributeBooleanTest() { // TODO: test attributeBoolean } - /** - * Test the property 'wrappedArray' - */ + /** Test the property 'wrappedArray' */ @Test public void wrappedArrayTest() { // TODO: test wrappedArray } - /** - * Test the property 'nameString' - */ + /** Test the property 'nameString' */ @Test public void nameStringTest() { // TODO: test nameString } - /** - * Test the property 'nameNumber' - */ + /** Test the property 'nameNumber' */ @Test public void nameNumberTest() { // TODO: test nameNumber } - /** - * Test the property 'nameInteger' - */ + /** Test the property 'nameInteger' */ @Test public void nameIntegerTest() { // TODO: test nameInteger } - /** - * Test the property 'nameBoolean' - */ + /** Test the property 'nameBoolean' */ @Test public void nameBooleanTest() { // TODO: test nameBoolean } - /** - * Test the property 'nameArray' - */ + /** Test the property 'nameArray' */ @Test public void nameArrayTest() { // TODO: test nameArray } - /** - * Test the property 'nameWrappedArray' - */ + /** Test the property 'nameWrappedArray' */ @Test public void nameWrappedArrayTest() { // TODO: test nameWrappedArray } - /** - * Test the property 'prefixString' - */ + /** Test the property 'prefixString' */ @Test public void prefixStringTest() { // TODO: test prefixString } - /** - * Test the property 'prefixNumber' - */ + /** Test the property 'prefixNumber' */ @Test public void prefixNumberTest() { // TODO: test prefixNumber } - /** - * Test the property 'prefixInteger' - */ + /** Test the property 'prefixInteger' */ @Test public void prefixIntegerTest() { // TODO: test prefixInteger } - /** - * Test the property 'prefixBoolean' - */ + /** Test the property 'prefixBoolean' */ @Test public void prefixBooleanTest() { // TODO: test prefixBoolean } - /** - * Test the property 'prefixArray' - */ + /** Test the property 'prefixArray' */ @Test public void prefixArrayTest() { // TODO: test prefixArray } - /** - * Test the property 'prefixWrappedArray' - */ + /** Test the property 'prefixWrappedArray' */ @Test public void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } - /** - * Test the property 'namespaceString' - */ + /** Test the property 'namespaceString' */ @Test public void namespaceStringTest() { // TODO: test namespaceString } - /** - * Test the property 'namespaceNumber' - */ + /** Test the property 'namespaceNumber' */ @Test public void namespaceNumberTest() { // TODO: test namespaceNumber } - /** - * Test the property 'namespaceInteger' - */ + /** Test the property 'namespaceInteger' */ @Test public void namespaceIntegerTest() { // TODO: test namespaceInteger } - /** - * Test the property 'namespaceBoolean' - */ + /** Test the property 'namespaceBoolean' */ @Test public void namespaceBooleanTest() { // TODO: test namespaceBoolean } - /** - * Test the property 'namespaceArray' - */ + /** Test the property 'namespaceArray' */ @Test public void namespaceArrayTest() { // TODO: test namespaceArray } - /** - * Test the property 'namespaceWrappedArray' - */ + /** Test the property 'namespaceWrappedArray' */ @Test public void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } - /** - * Test the property 'prefixNsString' - */ + /** Test the property 'prefixNsString' */ @Test public void prefixNsStringTest() { // TODO: test prefixNsString } - /** - * Test the property 'prefixNsNumber' - */ + /** Test the property 'prefixNsNumber' */ @Test public void prefixNsNumberTest() { // TODO: test prefixNsNumber } - /** - * Test the property 'prefixNsInteger' - */ + /** Test the property 'prefixNsInteger' */ @Test public void prefixNsIntegerTest() { // TODO: test prefixNsInteger } - /** - * Test the property 'prefixNsBoolean' - */ + /** Test the property 'prefixNsBoolean' */ @Test public void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } - /** - * Test the property 'prefixNsArray' - */ + /** Test the property 'prefixNsArray' */ @Test public void prefixNsArrayTest() { // TODO: test prefixNsArray } - /** - * Test the property 'prefixNsWrappedArray' - */ + /** Test the property 'prefixNsWrappedArray' */ @Test public void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } - } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index ae3f39eee7e..f9d94e243c6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3de7828f3c6..5863e89d07f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8743aebff7f..819f5584346 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 08f3dbd8eda..d0c10077a98 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -84,6 +84,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 34ff567529f..877502c1681 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index ef48b228b60..6e6337b13f7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -43,6 +43,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 45878377ff6..f37f91ac286 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f923e8e3858..ccd38c956d0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 c384a526cfb..fde8cfea9c2 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 @@ -56,6 +56,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a2796b36007..cb76f14ae19 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,6 +43,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 0280968ee97..f64ab1cf4a1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -43,6 +43,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 5adcbddfb2f..5aaddbbf491 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -51,6 +51,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index d6ee7b08ffb..7e450b49921 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -85,6 +85,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 975b04a4e61..8166257c609 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -79,6 +79,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index c4473760390..b1ead3dabc9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -60,6 +60,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index 25b62faf367..928cca80526 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -50,6 +50,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index 98b05e0b453..840565434b8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -40,6 +40,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index 5766fb273da..d447bb8af00 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -44,6 +44,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index 75a0bcf5366..e5da2c0342b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -41,6 +41,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index b195964c25c..48d45192590 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -40,6 +40,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index d0f9cba0dfb..c660018d8b8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -46,6 +46,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index 5a0a758be94..6f512f0f715 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -40,6 +40,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 6ec6d640040..ad10f67b0d7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -116,6 +116,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 711a2b430ec..f144e900b2f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -201,6 +201,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 1b11024f3ed..682f4f7ab6f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -46,6 +46,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index 5b0b620ec7e..c0cd9d15daf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -97,6 +97,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 3a9230d9898..eb5c4d964c4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -44,6 +44,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index 77751384b3e..312bffabdfe 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -90,6 +90,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6d0df6c1456..6286fd7b31d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -54,6 +54,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index d64b693d80a..d0e1dfa83a6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -45,6 +45,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e753c7bc100..4ee61b5bab9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -48,6 +48,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 4c2f7d6ebb5..0879834b0b5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -41,6 +41,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index 78ea835199c..693f2a9e0a2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -53,6 +53,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index 94e8dcf5fda..bfc4e0c5bed 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -41,6 +41,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index 7001777b107..32ca832daf7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -98,6 +98,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index 6ce212beff7..7e2fc32926a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -49,6 +49,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index fbd45da4012..cb9fc8fefa9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -103,6 +104,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -213,6 +216,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index afa3baa8069..d5d7a523467 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -44,6 +44,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index b660e018d38..b380bed0126 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -40,6 +40,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index 83871ea03b9..f5f137bd05d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -44,6 +44,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 5cea541bdbc..0234af961fc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -59,6 +59,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 959d28e5fa9..9ff7733be73 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -63,6 +63,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 1d14c68d04a..5267a6c43f8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -68,6 +68,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index 2c89cecab78..ce281b24653 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -155,6 +155,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java index dbd3bf1312e..274416e5ded 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java @@ -151,6 +151,13 @@ public class JSON { return this; } + /** + * Configure the parser to be liberal in what it accepts. + * + * @param lenientOnJson Set it to true to ignore some syntax errors + * @return JSON + * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + */ public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; @@ -179,7 +186,7 @@ public class JSON { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index ce745ee4ef6..6d9fb4b0829 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -38,6 +38,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 8cce4941b32..2696ab3b28c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 90182c8b125..1101adfc1aa 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -38,6 +38,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 1b74276b62a..f9eef4cc8a9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -80,6 +80,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 0bc28f8419e..585b989d1ec 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -38,6 +38,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f74b57204ca..061cd04d148 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 31375b34814..457a011f3e9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -38,6 +38,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index da3b0758ca6..6dd39c57ccf 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -38,6 +38,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 fa41866dd88..d0561d918a5 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 @@ -43,7 +43,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8722a17ecb..d64ee1c3d04 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -39,6 +39,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index db2ca52d05b..054a5cc7d7b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -39,6 +39,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 7d5f3424b6f..e31cd2b7e09 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -47,6 +47,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 41f04384b0f..ce620ddfcb4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -89,7 +89,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 37247aea21b..c4f9e990b38 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -87,6 +87,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index e5b2f360b70..95713ca6c4d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -56,6 +56,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index b71f9425340..e0e52a2b159 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index fe3831b05ec..8b97e3b2b90 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -36,6 +36,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 78b02a1a25d..ba1ed8a254f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -40,6 +40,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index b10c2edf12d..50081ae04ab 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -37,6 +37,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index ef207b1dba6..6ef69ead6ec 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -36,6 +36,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 0afb21e75a2..030313d050c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -38,7 +38,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index dbf0844cb40..5be5691895d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -36,6 +36,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index b3d2efba73a..20963b543ad 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -136,6 +136,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 014e5c86b6b..7f6f400d06a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -245,6 +245,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 3007cfaf0f5..f64317ec16a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,6 +42,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index 81242ba6f04..c00fe425ad6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -93,6 +93,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7ebe8807f1e..1ef8d3843d6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -40,6 +40,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 9b23ee3291c..3927ebee5f8 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -98,6 +98,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e7a34876fc4..c4d90ecc429 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -50,6 +50,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 8fabafe07eb..ddcb13b399d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -41,6 +41,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9ac46956160..4d4eae275e5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -44,6 +44,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 8c848546c53..8640d927962 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -37,6 +37,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index da1cd8d824b..2758711e84b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -49,6 +49,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 2dc1f6f02a6..5899f65a5d6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -37,6 +37,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 477b9c8a3df..df8865dd0b7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -106,6 +106,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 2013747843e..ebf67bacefc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -45,6 +45,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index 7357148449e..901f293dd1d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -111,6 +111,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 14b4529553f..969b9061359 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,6 +40,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index 264c1ec4856..06b70cadcc7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -36,6 +36,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index d3fc7c16d14..15378fc8ad6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -40,6 +40,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index e4e25c807e4..36d491c78fa 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -55,6 +55,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ddbff0d1263..3e10b16870d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -59,6 +59,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index f46e3487727..12fb6d2787c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -64,6 +64,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index b0bf2ff8ee3..4f37c48d2a0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -151,6 +151,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71c101d18c0..6bb1861f65d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 4485050c8ef..8563c7d9e70 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 @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index b7fe3006548..87ec77092d6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9800999e52d..2ae36081062 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index df7ebdaef30..adf9cfe9953 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff20dc37fe..ef3cd0d7b5b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index 33a1e115a64..a8dcac646f6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { 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 0d95c6e8542..093e4897144 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 @@ -436,6 +436,7 @@ public class ApiClient extends JavaTimeFormatter { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0c1a3b98fd1..1c049d42ab0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3775e05a159..703308a5e55 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -46,6 +46,8 @@ public class AdditionalPropertiesArray extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 0a66ce2fce4..cea7fda7e46 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 730d13094ca..b9818df7b04 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -121,6 +121,8 @@ public class AdditionalPropertiesClass { @XmlElement(name = "anytype_3") private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 3b04202f74b..0e67727b743 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesInteger extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 2b2d665ca9b..2d0f4c51cad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -46,6 +46,8 @@ public class AdditionalPropertiesNumber extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 061cee4560b..87e1d3b7c1c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesObject extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8b582c4dcab..8607e3bdc3a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -45,6 +45,8 @@ public class AdditionalPropertiesString extends HashMap { @XmlElement(name = "name") private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 c7bfcde7b43..c4934b6766c 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 @@ -60,6 +60,8 @@ public class Animal { @XmlElement(name = "color") private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 593b7849b81..99a738af3bc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -49,6 +49,8 @@ public class ArrayOfArrayOfNumberOnly { @XmlElement(name = "arrayArrayNumber") private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index bdfde065539..e022a51cb5c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -49,6 +49,8 @@ public class ArrayOfNumberOnly { @XmlElement(name = "arrayNumber") private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index b36953aa09e..e7e2c942e43 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -65,6 +65,8 @@ public class ArrayTest { @XmlElement(name = "arrayArrayOfModel") private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index c746c876767..cc840ec5411 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -94,6 +94,8 @@ public class BigCat extends Cat { @XmlElement(name = "kind") private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index eed55a9ec4f..15a88cc6aeb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -88,6 +88,8 @@ public class BigCatAllOf { @XmlElement(name = "kind") private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index a56603e687a..6ba26921340 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -68,6 +68,8 @@ public class Capitalization { @XmlElement(name = "ATT_NAME") private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index 92c1f95fd41..901f289caaf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -53,6 +53,8 @@ public class Cat extends Animal { @XmlElement(name = "declawed") private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 730d6c2b6bf..bae7e67fe71 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -43,6 +43,8 @@ public class CatAllOf { @XmlElement(name = "declawed") private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 0e9d0507d56..d4fdf9c896f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -48,6 +48,8 @@ public class Category { @XmlElement(name = "name") private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index cbef23dc6e7..67752e8f16f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -44,6 +44,8 @@ public class ClassModel { @XmlElement(name = "_class") private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 8b3efb8b827..983d14e0ad4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -43,6 +43,8 @@ public class Client { @XmlElement(name = "client") private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index e4846d77e38..a382687fa01 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -49,6 +49,8 @@ public class Dog extends Animal { @XmlElement(name = "breed") private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index dcf781ab549..da3a0d62108 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -43,6 +43,8 @@ public class DogAllOf { @XmlElement(name = "breed") private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index 7eefc4df737..ec61f354cc7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -131,6 +131,8 @@ public class EnumArrays { @XmlElement(name = "arrayEnum") private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 938acc8d16f..44a1106b42f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -226,6 +226,8 @@ public class EnumTest { @XmlElement(name = "outerEnum") private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 069518e6d8d..75e1bf068b2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -53,6 +53,8 @@ public class FileSchemaTestClass { @XmlElement(name = "files") private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index 38e9a91ffc5..c6fa4aa7e6e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -113,6 +113,8 @@ public class FormatTest { @XmlElement(name = "BigDecimal") private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 883d0faea8b..097f0f784b7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -48,6 +48,8 @@ public class HasOnlyReadOnly { @XmlElement(name = "foo") private String foo; + public HasOnlyReadOnly() { + } /** * Get bar diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 9975f8ca2c9..b3a9dfb9eff 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -112,6 +112,8 @@ public class MapTest { @XmlElement(name = "inner") private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 539584bde58..4f80f5ecfaa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -62,6 +62,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @XmlElement(name = "inner") private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 06356c0dcd1..44c6d249fe5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -49,6 +49,8 @@ public class Model200Response { @XmlElement(name = "class") private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dc878c92542..67fe248692c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -53,6 +53,8 @@ public class ModelApiResponse { @XmlElement(name = "message") private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 98bbef5af6d..eb1143e8071 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,6 +44,8 @@ public class ModelReturn { @XmlElement(name = "return") private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index f1708029a71..54d844de397 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -59,6 +59,8 @@ public class Name { @XmlElement(name = "123Number") private Integer _123number; + public Name() { + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 961b34a0015..54eadddec84 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,6 +44,8 @@ public class NumberOnly { @XmlElement(name = "JustNumber") private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 2a24a6c5043..ffae074f6c2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -111,6 +111,8 @@ public class Order { @XmlElement(name = "complete") private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 83b4d247f1a..0c326ec93dc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -54,6 +54,8 @@ public class OuterComposite { @XmlElement(name = "my_boolean") private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 8100eed824b..476daea7b3b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -124,6 +125,8 @@ public class Pet { @XmlElement(name = "status") private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -239,6 +242,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) // items.xmlName= diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index df234d47915..7cdee18b12e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -48,6 +48,8 @@ public class ReadOnlyFirst { @XmlElement(name = "baz") private String baz; + public ReadOnlyFirst() { + } /** * Get bar diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index b306d5b64ff..bf584e481a3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -43,6 +43,8 @@ public class SpecialModelName { @XmlElement(name = "$special[property.name]") private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index 7947cd8d81e..284f4a6ad98 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -48,6 +48,8 @@ public class Tag { @XmlElement(name = "name") private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 624e6aa3ff1..08a78ab1c13 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -69,6 +69,8 @@ public class TypeHolderDefault { @XmlElement(name = "arrayItem") private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 57ca9a24842..559974b2aeb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -74,6 +74,8 @@ public class TypeHolderExample { @XmlElement(name = "arrayItem") private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 5c64d86c654..4fda57eabde 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -78,6 +78,8 @@ public class User { @XmlElement(name = "userStatus") private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index ee00416d37b..b8feb912256 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -218,6 +218,8 @@ public class XmlItem { @XmlElementWrapper(namespace="http://f.com/schema", name = "prefix_ns_wrapped_array") private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { 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 0b49be2164e..89f43f67cc1 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 @@ -431,6 +431,7 @@ public class ApiClient extends JavaTimeFormatter { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71c101d18c0..6bb1861f65d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 4485050c8ef..8563c7d9e70 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 @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index b7fe3006548..87ec77092d6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9800999e52d..2ae36081062 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index df7ebdaef30..adf9cfe9953 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff20dc37fe..ef3cd0d7b5b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index 33a1e115a64..a8dcac646f6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 78f3e0fdb76..933ad403472 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index e3119403bd7..237f40d1b6b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index af3d5ea9ee0..5ef118dde7c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 91df8b6ecb3..9135167a9b9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -83,6 +83,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 0170f0010d4..170a837b9f7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e20b0d69d14..a8c569e21a4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -42,6 +42,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index ca4cb32b001..f65487cacad 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index b21fea22223..5c2ff9b8437 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -41,6 +41,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 c20a5e9a464..aff9d725f16 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 @@ -55,6 +55,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 1ecba9ed7b3..9257487c56e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 44818d498c4..9a53f9d446c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index e596fe1035a..e0a84f4289b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -50,6 +50,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index d22b4cc1976..5d4517b9b92 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -84,6 +84,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 705bcbcbf0a..2fc2d25b511 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -78,6 +78,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index de2c02b916b..23cdbede201 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -59,6 +59,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index f5d55dd282e..a831aeff451 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index 5d6e28d6dbd..1674eae9c12 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -39,6 +39,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 6fe982ab35c..1fb4f6f0d60 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -43,6 +43,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index 3d1200fdcc7..55f441114cf 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,6 +40,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index 17b2e308f32..6020d6086b2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -39,6 +39,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index 5c0199e1aff..a5acff86622 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -45,6 +45,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 028dbeef834..184f58e1a7d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -39,6 +39,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index bb0d6e66296..9580eca2fe0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -115,6 +115,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index d9086d5f861..82c14c6a24f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -200,6 +200,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e50ec5215e9..4bcc644244e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -45,6 +45,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index 3a50d7dd516..cba5025fe7d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -96,6 +96,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 431396413ae..7eb4e87ff7d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -43,6 +43,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 0c9c17ba13d..6c23883998d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -89,6 +89,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3f9bc7cba78..be0bcca382b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -53,6 +53,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index 4815a48e4e6..0eae3e4158b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -44,6 +44,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5e8f1c2fb5d..1dcde151211 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -47,6 +47,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index 3c774358092..6418b010147 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,6 +40,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 35ae2b29f64..b663dd7d5e9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -52,6 +52,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index 3dcafc33b8c..82f64040400 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -40,6 +40,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index 9b8cf2afacc..acda20d5db0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -97,6 +97,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index 6347f87be41..b6e9c9923ae 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -48,6 +48,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 63707cf2cc6..025e32508c8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -102,6 +103,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -212,6 +215,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e1c18697589..f6fa0a065b5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,6 +43,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 00f09fc6541..eaeb69cda53 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -39,6 +39,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index f3663a1b2c1..4decae666b1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -43,6 +43,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 5cfb572e67a..5932d2a416d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -58,6 +58,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 5f612fae672..bbf0c177813 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -62,6 +62,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index 1a87a5c92ef..21a022681e4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -67,6 +67,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index a788eb758d9..6bff621c24b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -154,6 +154,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb0175c213..1b5a3cd2239 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 90e9afca2f0..6835e103b62 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f6e70331f6e..3f2f1b3ba82 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0495881506d..21db6cb109f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -77,6 +77,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 208dfdbc15f..c90f346b182 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b008b847a7e..b9a1d371fd3 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c2ce3b2fbe2..a61d030c6c0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcecf6e69dd..4745fed6651 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 ee3cf38a18a..24f916d3add 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 @@ -40,7 +40,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7e3ba8195c7..8c7d7694734 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 279edaea8a7..2408d257708 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java index b1bfac1da86..1c7469d68e0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -44,6 +44,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java index ee503f76942..37b2bb735b9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -86,7 +86,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a6bdb2bbe3f..8334448ffdf 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -84,6 +84,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java index 42909659d9c..a99f3586985 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,6 +53,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java index 19705043a2f..b226ce008f2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java index 6be8b4534b1..39c740ffe3f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java index fdbddf336d3..9d7c0e4a1cd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java @@ -37,6 +37,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java index f43b881b90c..eb1d43e00eb 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java index 1702dbadd88..8e5e1694ace 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java index 5c80057e78e..d4935b3df27 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java index 9e311a1f6af..b1f42a5f620 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java index 9a9c2f1a59a..2b249f35495 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -133,6 +133,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 47007ec6f1b..55ddcb829be 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -242,6 +242,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a6c4008d1e9..d3feb88b1a9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,6 +39,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java index af715329445..52900682b0f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,6 +90,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7f915754ffa..b8194dc1df6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,6 +37,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index f8fedfcde0c..cc0b38f6c4d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -95,6 +95,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0c225d1f6cd..1c705d4b1ee 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,6 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java index f11d9e5d570..46150911764 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 595d829ad8d..93e9feb5b86 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,6 +41,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java index dc27972cb67..4c0e74f87eb 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java index c6fd4106f2b..a0bd099370d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java @@ -46,6 +46,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java index 172856aaf7a..46830867289 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java index 34b170e3ecd..530f0eefd41 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java @@ -103,6 +103,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java index 32829a45215..d8c60dcf97a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,6 +42,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index 8b0094ed608..1c1c47105f9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -108,6 +108,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 23ca124c518..e452bf03a01 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,6 +37,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java index ffd53c78dee..271e41f8323 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java index f34a659e794..181b1e65048 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java @@ -37,6 +37,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ed5494ea76b..f9fdaf50fe4 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,6 +52,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2fd9419115d..a19d60e9022 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -56,6 +56,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java index 86d4751120a..166fea9628c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java @@ -61,6 +61,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java index a09ec289d51..197aac987bc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -148,6 +148,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb0175c213..1b5a3cd2239 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 90e9afca2f0..6835e103b62 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f6e70331f6e..3f2f1b3ba82 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0495881506d..21db6cb109f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -77,6 +77,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 208dfdbc15f..c90f346b182 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b008b847a7e..b9a1d371fd3 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c2ce3b2fbe2..a61d030c6c0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcecf6e69dd..4745fed6651 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 ee3cf38a18a..24f916d3add 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 @@ -40,7 +40,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7e3ba8195c7..8c7d7694734 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 279edaea8a7..2408d257708 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java index b1bfac1da86..1c7469d68e0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -44,6 +44,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java index ee503f76942..37b2bb735b9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -86,7 +86,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a6bdb2bbe3f..8334448ffdf 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -84,6 +84,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java index 42909659d9c..a99f3586985 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,6 +53,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java index 19705043a2f..b226ce008f2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java index 6be8b4534b1..39c740ffe3f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java index fdbddf336d3..9d7c0e4a1cd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java @@ -37,6 +37,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java index f43b881b90c..eb1d43e00eb 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java index 1702dbadd88..8e5e1694ace 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java index 5c80057e78e..d4935b3df27 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java index 9e311a1f6af..b1f42a5f620 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java index 9a9c2f1a59a..2b249f35495 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -133,6 +133,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 47007ec6f1b..55ddcb829be 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -242,6 +242,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a6c4008d1e9..d3feb88b1a9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,6 +39,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java index af715329445..52900682b0f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,6 +90,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7f915754ffa..b8194dc1df6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,6 +37,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index f8fedfcde0c..cc0b38f6c4d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -95,6 +95,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0c225d1f6cd..1c705d4b1ee 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,6 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java index f11d9e5d570..46150911764 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 595d829ad8d..93e9feb5b86 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,6 +41,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java index dc27972cb67..4c0e74f87eb 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java index c6fd4106f2b..a0bd099370d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java @@ -46,6 +46,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java index 172856aaf7a..46830867289 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java index 34b170e3ecd..530f0eefd41 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java @@ -103,6 +103,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java index 32829a45215..d8c60dcf97a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,6 +42,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index 8b0094ed608..1c1c47105f9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -108,6 +108,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 23ca124c518..e452bf03a01 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,6 +37,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java index ffd53c78dee..271e41f8323 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java index f34a659e794..181b1e65048 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java @@ -37,6 +37,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ed5494ea76b..f9fdaf50fe4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,6 +52,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2fd9419115d..a19d60e9022 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -56,6 +56,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java index 86d4751120a..166fea9628c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java @@ -61,6 +61,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java index a09ec289d51..197aac987bc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -148,6 +148,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb0175c213..1b5a3cd2239 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 90e9afca2f0..6835e103b62 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f6e70331f6e..3f2f1b3ba82 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0495881506d..21db6cb109f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -77,6 +77,8 @@ public class AdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_ANYTYPE3) private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 208dfdbc15f..c90f346b182 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b008b847a7e..b9a1d371fd3 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c2ce3b2fbe2..a61d030c6c0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcecf6e69dd..4745fed6651 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,8 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java index ee3cf38a18a..24f916d3add 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java @@ -40,7 +40,7 @@ public class Animal { @SerializedName(SERIALIZED_NAME_COLOR) private String color = "red"; - public Animal() { + public Animal() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7e3ba8195c7..8c7d7694734 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 279edaea8a7..2408d257708 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,8 @@ public class ArrayOfNumberOnly { @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java index b1bfac1da86..1c7469d68e0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -44,6 +44,8 @@ public class ArrayTest { @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java index ee503f76942..37b2bb735b9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java @@ -86,7 +86,7 @@ public class BigCat extends Cat { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; - public BigCat() { + public BigCat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a6bdb2bbe3f..8334448ffdf 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -84,6 +84,8 @@ public class BigCatAllOf { @SerializedName(SERIALIZED_NAME_KIND) private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java index 42909659d9c..a99f3586985 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,6 +53,8 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java index 19705043a2f..b226ce008f2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; - public Cat() { + public Cat() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java index 6be8b4534b1..39c740ffe3f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,8 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java index fdbddf336d3..9d7c0e4a1cd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java @@ -37,6 +37,8 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java index f43b881b90c..eb1d43e00eb 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,8 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java index 1702dbadd88..8e5e1694ace 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,8 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java index 5c80057e78e..d4935b3df27 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,7 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; - public Dog() { + public Dog() { this.className = this.getClass().getSimpleName(); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java index 9e311a1f6af..b1f42a5f620 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,8 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java index 9a9c2f1a59a..2b249f35495 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -133,6 +133,8 @@ public class EnumArrays { @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index 47007ec6f1b..55ddcb829be 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -242,6 +242,8 @@ public class EnumTest { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a6c4008d1e9..d3feb88b1a9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,6 +39,8 @@ public class FileSchemaTestClass { @SerializedName(SERIALIZED_NAME_FILES) private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java index af715329445..52900682b0f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,6 +90,8 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7f915754ffa..b8194dc1df6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,6 +37,18 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java index f8fedfcde0c..cc0b38f6c4d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java @@ -95,6 +95,8 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0c225d1f6cd..1c705d4b1ee 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,6 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName(SERIALIZED_NAME_MAP) private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java index f11d9e5d570..46150911764 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,8 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 595d829ad8d..93e9feb5b86 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,6 +41,8 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java index dc27972cb67..4c0e74f87eb 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,8 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java index c6fd4106f2b..a0bd099370d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java @@ -46,6 +46,18 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java index 172856aaf7a..46830867289 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,8 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java index 34b170e3ecd..530f0eefd41 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java @@ -103,6 +103,8 @@ public class Order { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java index 32829a45215..d8c60dcf97a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,6 +42,8 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java index 8b0094ed608..1c1c47105f9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java @@ -108,6 +108,8 @@ public class Pet { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet() { + } public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 23ca124c518..e452bf03a01 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,6 +37,16 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java index ffd53c78dee..271e41f8323 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,8 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java index f34a659e794..181b1e65048 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java @@ -37,6 +37,8 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ed5494ea76b..f9fdaf50fe4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,6 +52,8 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2fd9419115d..a19d60e9022 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -56,6 +56,8 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java index 86d4751120a..166fea9628c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java @@ -61,6 +61,8 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java index a09ec289d51..197aac987bc 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java @@ -148,6 +148,8 @@ public class XmlItem { @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71c101d18c0..6bb1861f65d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 4485050c8ef..8563c7d9e70 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 4b657c15d3f..fb9fdfe8bfa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9800999e52d..2ae36081062 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 3555baa0726..098dcd4e8d4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index df7ebdaef30..adf9cfe9953 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff20dc37fe..ef3cd0d7b5b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 33a1e115a64..a8dcac646f6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dca2873964f..57b75a4e5dd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType() { + } public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 44b66aea15f..dfd316bf104 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray() { + } public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ec9e94fc8bf..c6e7164efa7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean() { + } public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71c101d18c0..6bb1861f65d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -81,6 +81,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; private Object anytype3; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d7bf9ff106c..2c67aa96367 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger() { + } public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 34b272236ff..90250b719b8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -40,6 +40,8 @@ public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber() { + } public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 98c7a826084..abd6ff204b7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject() { + } public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8d484682eae..324c57fde5e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -39,6 +39,8 @@ public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString() { + } public AdditionalPropertiesString name(String name) { 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 4485050c8ef..8563c7d9e70 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 @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index ecc0f4a49b5..8f57023a54a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -82,6 +82,8 @@ public class BigCat extends Cat { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCat() { + } public BigCat kind(KindEnum kind) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8ad59ef4000..fb358abee3c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -76,6 +76,8 @@ public class BigCatAllOf { public static final String JSON_PROPERTY_KIND = "kind"; private KindEnum kind; + public BigCatAllOf() { + } public BigCatAllOf kind(KindEnum kind) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index 60f69c5041a..4726746bb7b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -47,6 +47,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index 2178182fe27..12b3b19a575 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -198,6 +198,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index 72fb5c496d2..22fc2aa19c6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -94,6 +94,8 @@ public class FormatTest { public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; private BigDecimal bigDecimal; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b63ce34733..c82c9ddc19b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index cbbef0485bd..34f645fc328 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index b55662453e8..0d71d05b2ee 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index df7ebdaef30..adf9cfe9953 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,6 +56,8 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderDefault() { + } public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff20dc37fe..ef3cd0d7b5b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -60,6 +60,8 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + } public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index 33a1e115a64..a8dcac646f6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -152,6 +152,8 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; private List prefixNsWrappedArray = null; + public XmlItem() { + } public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java index ae73f7c6c61..353a788d4db 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -424,6 +424,7 @@ public class ApiClient extends JavaTimeFormatter { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java index 61c33e3256c..02d26b01105 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -58,6 +58,8 @@ public class ByteArrayObject { public static final String JSON_PROPERTY_INT_FIELD = "intField"; private BigDecimal intField; + public ByteArrayObject() { + } public ByteArrayObject nullableArray(byte[] nullableArray) { this.nullableArray = JsonNullable.of(nullableArray); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index 17e3523aa38..b5c673453ca 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -445,6 +445,7 @@ public class ApiClient extends JavaTimeFormatter { } if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; for (final Entry entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5b8b75022df..721ccbb9c00 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; private Map> mapOfMapProperty = null; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapProperty(Map mapProperty) { 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 f1c32090efd..ee588a3cf4c 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 @@ -51,6 +51,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 70cca2e2a3c..99c32687894 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ea42f683b60..b995540f628 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,6 +40,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index f2e8b9b945e..ab3d8a2cc28 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -48,6 +48,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index ce40f914789..9dc31fc1bea 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index ccfe6d7ae2d..6cd5f2811ef 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -43,6 +43,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index ea0d8f78ef1..9af537be46a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,6 +37,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index b4e06b7fa56..a76c23cd2c4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index a695bc68f7d..1e6987ac739 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index f2902bfcbec..a91695f7053 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 7e40874a37e..8ce005bca55 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -39,6 +39,8 @@ public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public DeprecatedObject() { + } public DeprecatedObject name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 74d8f9c0603..306a371d5a3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -43,6 +43,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 1b671eab9e8..22f41e01ea7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,6 +37,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 0bc1956f7db..dd78a19e82a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,6 +113,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index b4de1289303..a33250dbb6d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -217,6 +217,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0c986e7b880..3aa79df4ac5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -43,6 +43,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java index 67e5208c76c..23e8d2d8476 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java @@ -37,6 +37,8 @@ public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; private String bar = "bar"; + public Foo() { + } public Foo bar(String bar) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index c2a9a96f6ba..f1ef660aa6c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -102,6 +102,8 @@ public class FormatTest { public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; private String patternWithDigitsAndDelimiter; + public FormatTest() { + } public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4c63faeaecc..a79abdb993e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,6 +41,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 9cf29c66914..ca53feb8faa 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -42,6 +42,8 @@ public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; private JsonNullable nullableMessage = JsonNullable.undefined(); + public HealthCheckResult() { + } public HealthCheckResult nullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 16046669b22..bd42f4375dd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -38,6 +38,8 @@ public class InlineResponseDefault { public static final String JSON_PROPERTY_STRING = "string"; private Foo string; + public InlineResponseDefault() { + } public InlineResponseDefault string(Foo string) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 6fb8a3ca931..3b4a4aaf56d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -87,6 +87,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b63ce34733..c82c9ddc19b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -51,6 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index baeaf1006e5..a05c6986609 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4cd57ec875..8c90d064943 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,6 +45,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 0608885dbc5..06fc43f8eb5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 0ca5dd29bdd..8f1e9b423d2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -50,6 +50,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index e2f3b54200b..78c77b4385f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -92,6 +92,8 @@ public class NullableClass extends HashMap { public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; private Map objectItemsNullable = null; + public NullableClass() { + } public NullableClass integerProp(Integer integerProp) { this.integerProp = JsonNullable.of(integerProp); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 5b15bcaf320..77a36e15c97 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 00681d71b75..7d9ebe2cfde 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -53,6 +53,8 @@ public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_BARS = "bars"; private List bars = null; + public ObjectWithDeprecatedFields() { + } public ObjectWithDeprecatedFields uuid(String uuid) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index cbbef0485bd..34f645fc328 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d836a74bef..9a1e6511464 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 64d8bb8e20d..6dfd8bbdcf2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -38,6 +38,8 @@ public class OuterObjectWithEnumProperty { public static final String JSON_PROPERTY_VALUE = "value"; private OuterEnumInteger value; + public OuterObjectWithEnumProperty() { + } public OuterObjectWithEnumProperty value(OuterEnumInteger value) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index e72a63d28fa..7b39879b128 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -100,6 +101,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { @@ -207,6 +210,7 @@ public class Pet { } + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(Set photoUrls) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7efe61604d8..77c82ef6a3c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,6 +41,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index d72baf59f4b..95d47212ac4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,6 +37,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 6a94028f21f..a8e8b81ee31 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 953632044c4..83979c42fb7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,8 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User() { + } public User id(Long id) { diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 48829a1408e..662eff77a04 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost") } } @@ -53,11 +54,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun operation() : ModelWithEnumPropertyHavingDefault { - val localVariableConfig = operationRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = operationWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ModelWithEnumPropertyHavingDefault @@ -74,6 +71,24 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } } + /** + * + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun operationWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = operationRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation operation * diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c5dc803570a..634abe57b90 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a1d5839b900..7a1fafd594e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9519cfa7381..05f77db3037 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 0749111d3e6..6d866a98057 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -164,11 +194,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -185,6 +211,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -221,11 +268,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { - val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getAllPetsWithHttpInfo(lastUpdated = lastUpdated) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -242,6 +285,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get all pets + * + * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse?> { + val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getAllPets * @@ -279,11 +341,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -300,6 +358,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -331,11 +408,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -352,6 +425,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -385,11 +476,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -406,6 +493,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -442,11 +549,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -463,6 +566,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b191f42e355..c4700a70115 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -45,6 +45,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index ebc04af4962..a10b5ee2855 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -26,6 +26,7 @@ import org.openapitools.client.models.Pet import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -41,7 +42,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -56,11 +57,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun addPet(body: Pet) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -77,6 +74,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = addPetRequestConfig(body = body) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -109,11 +124,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -130,6 +141,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -164,11 +194,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -185,6 +211,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return@withContext request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -222,11 +267,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -243,6 +284,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return@withContext request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -279,11 +341,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getPetById(petId: kotlin.Long) : Pet = withContext(Dispatchers.IO) { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -300,6 +358,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -331,11 +408,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePet(body: Pet) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -352,6 +425,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = updatePetRequestConfig(body = body) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -385,11 +476,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -406,6 +493,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return@withContext request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -442,11 +549,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -463,6 +566,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return@withContext request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 6349ba587bd..33f04bb5423 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,6 +25,7 @@ import org.openapitools.client.models.Order import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -40,7 +41,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -55,11 +56,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteOrder(orderId: kotlin.String) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -76,6 +73,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -107,11 +122,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getInventory() : kotlin.collections.Map = withContext(Dispatchers.IO) { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -128,6 +139,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + val localVariableConfig = getInventoryRequestConfig() + + return@withContext request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -159,11 +188,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getOrderById(orderId: kotlin.Long) : Order = withContext(Dispatchers.IO) { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -180,6 +205,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -212,11 +256,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun placeOrder(body: Order) : Order = withContext(Dispatchers.IO) { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -233,6 +273,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 62b8abae696..7cb6348f010 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,6 +25,7 @@ import org.openapitools.client.models.User import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -40,7 +41,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -55,11 +56,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUser(body: User) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -76,6 +73,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = createUserRequestConfig(body = body) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -107,11 +122,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return@withContext request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -159,11 +188,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithListInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -180,6 +205,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return@withContext request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -211,11 +254,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteUser(username: kotlin.String) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -232,6 +271,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -264,11 +321,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getUserByName(username: kotlin.String) : User = withContext(Dispatchers.IO) { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -285,6 +338,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -318,11 +390,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String = withContext(Dispatchers.IO) { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -339,6 +407,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -374,11 +462,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun logoutUser() : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -395,6 +479,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = logoutUserRequestConfig() + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -426,11 +527,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updateUser(username: kotlin.String, body: User) : Unit = withContext(Dispatchers.IO) { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return@withContext when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -447,6 +544,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return@withContext request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 66b6d06546f..c6bd90a8cbe 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -47,6 +47,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4da62720f74..c75d4889d2e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts index 42324041d66..2c891e8fa4f 100644 --- a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.10" // kotlin_version - kotlin("plugin.serialization") version "1.5.10" // kotlin_version + kotlin("multiplatform") version "1.5.31" // kotlin_version + kotlin("plugin.serialization") version "1.5.31" // kotlin_version } group = "org.openapitools" version = "1.0.0" -val kotlin_version = "1.5.10" -val coroutines_version = "1.5.0" -val serialization_version = "1.2.1" -val ktor_version = "1.6.0" +val kotlin_version = "1.5.31" +val coroutines_version = "1.5.2" +val serialization_version = "1.3.0" +val ktor_version = "1.6.3" repositories { mavenCentral() diff --git a/samples/client/petstore/kotlin-multiplatform/pom.xml b/samples/client/petstore/kotlin-multiplatform/pom.xml index 6397a0668d0..f4ff095e65a 100644 --- a/samples/client/petstore/kotlin-multiplatform/pom.xml +++ b/samples/client/petstore/kotlin-multiplatform/pom.xml @@ -26,6 +26,20 @@ exec-maven-plugin 1.2.1 + + bundle-clean + clean + + exec + + + /bin/bash + + gradlew + clean + + + bundle-test integration-test diff --git a/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts b/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts index 15cae2a9fd0..e471be1cddc 100644 --- a/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts @@ -1,2 +1 @@ -enableFeaturePreview("GRADLE_METADATA") rootProject.name = "kotlin-client-petstore-multiplatform" \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 5d1237fe7f0..86649ad5082 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index eaba8410d1b..fc03f3fb216 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index f9b43b19735..d68ed63e17c 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 6c086b53454..cb6d8697017 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ internal open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8c27503582d..164fa99175a 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet? { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet? @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index c616a2dd05c..5493c72bd74 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map? { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map? @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order? { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order? @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order? { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order? @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index c65ff9948ae..e8c09009486 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User? { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User? @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String? @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4da62720f74..c75d4889d2e 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index bd1d00d6e5d..217d6fe0199 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -42,6 +42,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 3bb7d9c4d66..46bb56cee10 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -201,9 +201,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 51a186e48fa..11032f9f16c 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -204,9 +204,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4aa4323fc5b..2197b6acb7a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -201,9 +201,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3847bd974ef..8cb9c538aff 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { - val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(apiKey = apiKey, petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param apiKey (optional) + * @param petId Pet id to delete + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4da62720f74..c75d4889d2e 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f81000598ca..f82c6d3fa4c 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 59ed587ef74..aca19570547 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.PetEnum import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getEnum() : PetEnum { - val localVariableConfig = getEnumRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getEnumWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as PetEnum @@ -74,6 +71,24 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get enums + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getEnumWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = getEnumRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getEnum * diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c5dc803570a..634abe57b90 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..7ccfb70d6d5 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -39,7 +40,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = addPetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = addPetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation addPet * @@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deletePet * @@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + val localVariableConfig = findPetsByStatusRequestConfig(status = status) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByStatus * @@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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 + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + @Suppress("DEPRECATION") + val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation findPetsByTags * @@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPetByIdWithHttpInfo(petId = petId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Pet @@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getPetByIdRequestConfig(petId = petId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getPetById * @@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updatePetWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + val localVariableConfig = updatePetRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePet * @@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updatePetWithForm * @@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request, ApiResponse>( - localVariableConfig - ) + val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse @@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) + + return request, ApiResponse>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation uploadFile * diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..a3a2940291f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteOrder * @@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) + val localVarResponse = getInventoryWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map @@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiInfrastructureResponse?> + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + val localVariableConfig = getInventoryRequestConfig() + + return request>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getInventory * @@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * 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 + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getOrderById * @@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = placeOrderWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as Order @@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + val localVariableConfig = placeOrderRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation placeOrder * diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..a68290f0718 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiInfrastructureResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -38,7 +39,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } @@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = createUserWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + val localVariableConfig = createUserRequestConfig(body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUser * @@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithArrayInput * @@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request, Unit>( - localVariableConfig - ) + val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + val localVariableConfig = createUsersWithListInputRequestConfig(body = body) + + return request, Unit>( + localVariableConfig + ) + } + /** * To obtain the request config of the operation createUsersWithListInput * @@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteUserWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = deleteUserRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation deleteUser * @@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getUserByNameWithHttpInfo(username = username) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as User @@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = getUserByNameRequestConfig(username = username) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation getUserByName * @@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = loginUserWithHttpInfo(username = username, password = password) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + val localVariableConfig = loginUserRequestConfig(username = username, password = password) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation loginUser * @@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = logoutUserWithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Logs out current logged in user session + * + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + val localVariableConfig = logoutUserRequestConfig() + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation logoutUser * @@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = updateUserWithHttpInfo(username = username, body = body) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return ApiInfrastructureResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + val localVariableConfig = updateUserRequestConfig(username = username, body = body) + + return request( + localVariableConfig + ) + } + /** * To obtain the request config of the operation updateUser * diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4da62720f74..c75d4889d2e 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index 3e6a00aaeae..66d211cb579 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -54,3 +54,9 @@ pub enum Status { Delivered, } +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index 358961f2c71..af6c8b6ca5d 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -54,3 +54,9 @@ pub enum Status { Sold, } +impl Default for Status { + fn default() -> Status { + Self::Available + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs index 3e6a00aaeae..66d211cb579 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs @@ -54,3 +54,9 @@ pub enum Status { Delivered, } +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs index 358961f2c71..af6c8b6ca5d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs @@ -54,3 +54,9 @@ pub enum Status { Sold, } +impl Default for Status { + fn default() -> Status { + Self::Available + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index 3e6a00aaeae..66d211cb579 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -54,3 +54,9 @@ pub enum Status { Delivered, } +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index 358961f2c71..af6c8b6ca5d 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -54,3 +54,9 @@ pub enum Status { Sold, } +impl Default for Status { + fn default() -> Status { + Self::Available + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 990b0eec1cf..c28311ac4c5 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -33,19 +33,23 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) - CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + CompletableFuture> addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -55,18 +59,24 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -77,20 +87,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) - CompletableFuture>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); + CompletableFuture>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +); /** @@ -102,20 +117,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) - CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +); /** @@ -127,20 +147,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) - CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -151,21 +177,27 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) - CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + CompletableFuture> updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -176,19 +208,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) - CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name, + +@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); /** @@ -199,12 +239,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -212,6 +254,12 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) - CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + +@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 7f3661002f6..9ef191dabaa 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -35,15 +35,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) - CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId); + CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + +); /** @@ -52,11 +57,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -75,17 +82,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) - CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId); + CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + +); /** @@ -95,15 +108,20 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) - CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body); + CompletableFuture> placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index c981ba142e0..d478c41ffac 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -34,14 +34,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - CompletableFuture> createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body); + CompletableFuture> createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); /** @@ -50,14 +54,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + CompletableFuture> createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -66,14 +74,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + CompletableFuture> createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -84,15 +96,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -103,17 +120,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) - CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -124,16 +147,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) - CompletableFuture> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + CompletableFuture> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -141,8 +171,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -160,14 +192,21 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body); + CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index 1114316e27f..f21d835af4d 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A category for a pet */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 523a64f1874..ec1b1b81d6a 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Describes the result of uploading an image resource */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 12230edbc05..2f24cd46851 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 1e1b76c7d11..a1f702f1a72 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A pet for sale in the pet store */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index 1476aa7d343..8e3f6732233 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A tag for a pet */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index 8bfae36516d..73fcf01b537 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A User who is purchasing from the pet store */ diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..471ca645a49 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,238 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Api(value = "Pet", description = "the Pet API") +public interface PetApi { + + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + */ + + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 405, message = "Invalid input") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + consumes = "application/json" + ) + com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + */ + + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 400, message = "Invalid pet value") }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @ApiResponse(code = 400, message = "Invalid status value") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); + + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @ApiResponse(code = 400, message = "Invalid tag value") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + + @ApiResponse(code = 400, message = "Invalid ID supplied"), + + @ApiResponse(code = 404, message = "Pet not found") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 400, message = "Invalid ID supplied"), + + @ApiResponse(code = 404, message = "Pet not found"), + + @ApiResponse(code = 405, message = "Validation exception") }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + consumes = "application/json" + ) + com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); + + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + */ + + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 405, message = "Invalid input") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = "application/x-www-form-urlencoded" + ) + com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") }) + }, tags={ "pet", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = "application/json", + consumes = "multipart/form-data" + ) + com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + +} diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..e03a4fbf787 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,120 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Api(value = "Store", description = "the Store API") +public interface StoreApi { + + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) + @ApiResponses(value = { + + @ApiResponse(code = 400, message = "Invalid ID supplied"), + + @ApiResponse(code = 404, message = "Order not found") }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{orderId}" + ) + com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId); + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand>> getInventory(); + + + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @ApiResponse(code = 400, message = "Invalid ID supplied"), + + @ApiResponse(code = 404, message = "Order not found") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{orderId}", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId); + + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @ApiResponse(code = 400, message = "Invalid Order") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand> placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); + +} diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..e928628d693 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,193 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import org.openapitools.model.User; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Api(value = "User", description = "the User API") +public interface UserApi { + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user" + ) + com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray" + ) + com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList" + ) + com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 400, message = "Invalid username supplied"), + + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = User.class), + + @ApiResponse(code = 400, message = "Invalid username supplied"), + + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation", response = String.class), + + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = "application/json" + ) + com.netflix.hystrix.HystrixCommand> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + com.netflix.hystrix.HystrixCommand> logoutUser(); + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + + @ApiResponse(code = 400, message = "Invalid user supplied"), + + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}" + ) + com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); + +} diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..e2eb3245338 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * A category for a pet + */ +@ApiModel(description = "A category for a pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Category { + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + 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(value = "") + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..2b85999b017 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,133 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * Describes the result of uploading an image resource + */ +@ApiModel(description = "Describes the result of uploading an image resource") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelApiResponse { + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..fe670efa69e --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,249 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * An order for a pets from the pet store + */ +@ApiModel(description = "An order for a pets from the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Order { + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + @Valid + + 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 + */ + @ApiModelProperty(value = "Order Status") + + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + @ApiModelProperty(value = "") + + + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..0513ffeb0f3 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,272 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * A pet for sale in the pet store + */ +@ApiModel(description = "A pet for sale in the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + @Valid + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + @Valid + + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @ApiModelProperty(value = "") + + @Valid + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + @ApiModelProperty(value = "pet status in the store") + + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..e067ae02327 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * A tag for a pet + */ +@ApiModel(description = "A tag for a pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Tag { + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..06286006724 --- /dev/null +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,258 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; + +/** + * A User who is purchasing from the pet store + */ +@ApiModel(description = "A User who is purchasing from the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class User { + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "") + + + 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 + */ + @ApiModelProperty(value = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index ac161122063..f71534f66c6 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -32,19 +32,23 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -54,18 +58,24 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -76,20 +86,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) - ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -101,20 +116,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -126,20 +146,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -150,21 +176,27 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -175,19 +207,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name, + +@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); /** @@ -198,12 +238,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -211,6 +253,12 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + +@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 6e7e5be954f..1ee6df7a6e7 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -34,15 +34,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + +); /** @@ -51,11 +56,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -74,17 +81,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + +); /** @@ -94,15 +107,20 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body); + ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index c9ca353c8d8..347a5db1223 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -33,14 +33,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body); + ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); /** @@ -49,14 +53,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -65,14 +73,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -83,15 +95,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -102,17 +119,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -123,16 +146,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) - ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -140,8 +170,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -155,8 +187,10 @@ public interface UserApi { * * @return endpoint configuration response (status code 200) */ + @ApiOperation(value = "logoutUserOptions", nickname = "logoutUserOptions", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "endpoint configuration response") }) @RequestMapping( method = RequestMethod.OPTIONS, @@ -174,14 +208,21 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java index 1114316e27f..f21d835af4d 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A category for a pet */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 523a64f1874..ec1b1b81d6a 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Describes the result of uploading an image resource */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java index 12230edbc05..2f24cd46851 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 1e1b76c7d11..a1f702f1a72 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A pet for sale in the pet store */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 1476aa7d343..8e3f6732233 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A tag for a pet */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java index 8bfae36516d..73fcf01b537 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A User who is purchasing from the pet store */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 5631204b336..1e8c3492df9 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -33,13 +33,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, @@ -47,7 +50,9 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet); + ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet pet); /** @@ -57,18 +62,24 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -79,19 +90,24 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) - ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); + ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +); /** @@ -103,19 +119,24 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +); /** @@ -127,20 +148,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -152,15 +179,20 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, @@ -168,7 +200,9 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet); + ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet pet); /** @@ -179,19 +213,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name, + +@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); /** @@ -202,12 +244,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -215,6 +259,12 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + +@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 08223c4449e..b9ffd3aa63d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -34,15 +34,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + +); /** @@ -51,11 +56,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -74,17 +81,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + +); /** @@ -94,9 +107,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, @@ -104,6 +120,8 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order); + ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order order); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 7bb28573780..e76bb0c7416 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -33,18 +33,22 @@ public interface UserApi { * @param user Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user", consumes = "application/json" ) - ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user); + ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User user); /** @@ -53,18 +57,22 @@ public interface UserApi { * @param user List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray", consumes = "application/json" ) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user); + ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List user); /** @@ -73,18 +81,22 @@ public interface UserApi { * @param user List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList", consumes = "application/json" ) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user); + ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List user); /** @@ -95,18 +107,23 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -117,17 +134,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -138,16 +161,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) - ResponseEntity loginUser(@NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser(@NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -155,11 +185,13 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -177,18 +209,25 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") }, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}", consumes = "application/json" ) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User user); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index a066fd9e30e..26f5a6768a3 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A category for a pet */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index 523a64f1874..ec1b1b81d6a 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Describes the result of uploading an image resource */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 12230edbc05..2f24cd46851 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 1e1b76c7d11..a1f702f1a72 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A pet for sale in the pet store */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index 1476aa7d343..8e3f6732233 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A tag for a pet */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index 8bfae36516d..73fcf01b537 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A User who is purchasing from the pet store */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index be3ac9d5d7a..4bc16c20f41 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -36,19 +36,23 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,18 +65,24 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -86,20 +96,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -128,20 +143,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -170,20 +190,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -211,21 +237,27 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -239,19 +271,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -265,12 +305,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -278,7 +320,13 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index b11987cc737..27b18c586c9 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 7bb296e335a..f53562d5cb1 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java index 1114316e27f..f21d835af4d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A category for a pet */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index 523a64f1874..ec1b1b81d6a 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Describes the result of uploading an image resource */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java index 12230edbc05..2f24cd46851 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 1e1b76c7d11..a1f702f1a72 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A pet for sale in the pet store */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java index 1476aa7d343..8e3f6732233 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A tag for a pet */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java index 8bfae36516d..73fcf01b537 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * A User who is purchasing from the pet store */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 554d96c9f2e..9ffe15ebc9a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -46,7 +46,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 43abbb33519..ac45c1f454b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,8 +19,9 @@ 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 7f43de2f5ea..87d1539d825 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,8 +18,9 @@ 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -59,8 +60,9 @@ 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -100,8 +102,9 @@ 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -141,8 +144,9 @@ 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -182,8 +186,9 @@ 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -224,8 +229,9 @@ 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -269,8 +275,9 @@ 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -325,8 +332,9 @@ 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -476,8 +484,9 @@ 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -545,8 +554,9 @@ 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -600,8 +610,9 @@ 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 34c654e4499..ac274a7c550 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,8 +19,9 @@ 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 29d68b9f526..5c22a59a5c5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index fbe47386f98..f2539226866 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f61db9b14f2..3fc59f9ef4f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 24e3924b253..5fe5eaa7bec 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -78,7 +78,8 @@ open class AlamofireRequestBuilder: RequestBuilder { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: HTTPHeaders(headers)) } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -141,7 +142,10 @@ open class AlamofireRequestBuilder: RequestBuilder { onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) + return request.task } + + return nil } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 4b777e5291a..45ca9d14c10 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -21,15 +21,26 @@ open class AnotherFakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - return try await withCheckedThrowingContinuation { continuation in - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4e950ffbc77..50aa3c4f2dd 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -20,15 +20,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Bool { - return try await withCheckedThrowingContinuation { continuation in - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -64,15 +75,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> OuterComposite { - return try await withCheckedThrowingContinuation { continuation in - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -108,15 +130,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Double { - return try await withCheckedThrowingContinuation { continuation in - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -152,15 +185,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - return try await withCheckedThrowingContinuation { continuation in - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -196,15 +240,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -241,15 +296,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -289,15 +355,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - return try await withCheckedThrowingContinuation { continuation in - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -348,15 +425,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) 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) async throws { - return try await withCheckedThrowingContinuation { continuation in - 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 in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = 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 in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -502,15 +590,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) 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) async throws { - return try await withCheckedThrowingContinuation { continuation in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -574,15 +673,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -632,15 +742,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -678,15 +799,26 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 83a249280d7..5bb42aa3465 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -21,15 +21,26 @@ open class FakeClassnameTags123API { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - return try await withCheckedThrowingContinuation { continuation in - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 434db991d21..8bc53adc9c0 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -21,15 +21,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -70,15 +81,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -131,15 +153,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - return try await withCheckedThrowingContinuation { continuation in - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -184,15 +217,26 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - return try await withCheckedThrowingContinuation { continuation in - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -237,15 +281,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Pet { - return try await withCheckedThrowingContinuation { continuation in - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -289,15 +344,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -339,15 +405,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -400,15 +477,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - return try await withCheckedThrowingContinuation { continuation in - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -461,15 +549,26 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - return try await withCheckedThrowingContinuation { continuation in - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 42bb0a26c4a..6cfed59b37a 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -21,15 +21,26 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -69,15 +80,26 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [String: Int] { - return try await withCheckedThrowingContinuation { continuation in - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -117,15 +139,26 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - return try await withCheckedThrowingContinuation { continuation in - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -166,15 +199,26 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - return try await withCheckedThrowingContinuation { continuation in - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c26f2f6984a..48b052e3fcf 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -21,15 +21,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -67,15 +78,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -112,15 +134,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -157,15 +190,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -206,15 +250,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> User { - return try await withCheckedThrowingContinuation { continuation in - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -255,15 +310,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - return try await withCheckedThrowingContinuation { continuation in - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in - switch result { - case let .success(response): - continuation.resume(returning: response.body!) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + continuation.resume(returning: response.body!) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -305,15 +371,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } @@ -350,15 +427,26 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - return try await withCheckedThrowingContinuation { continuation in - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in - switch result { - case .success: - continuation.resume(returning: ()) - case let .failure(error): - continuation.resume(throwing: error) + var task: URLSessionTask? + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + continuation.resume(returning: ()) + case let .failure(error): + continuation.resume(throwing: error) + } } } + } onCancel: { [task] in + task?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index fac7d89a646..6b18892fd71 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -25,8 +25,9 @@ open class AnotherFakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -34,7 +35,11 @@ open class AnotherFakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e1a64636954..57e4aee7b36 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -24,8 +24,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -33,7 +34,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -70,8 +75,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -79,7 +85,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -116,8 +126,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -125,7 +136,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -162,8 +177,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -171,7 +187,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -208,8 +228,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -217,7 +238,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -255,8 +280,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -264,7 +290,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -305,8 +335,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -314,7 +345,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -366,8 +401,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - 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 in + task = 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 in switch result { case .success: promise(.success(())) @@ -375,7 +411,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -522,8 +562,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -531,7 +572,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -596,8 +641,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -605,7 +651,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -656,8 +706,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -665,7 +716,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -704,8 +759,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -713,7 +769,11 @@ open class FakeAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index c28ec3ec79c..963f5b9ff8d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -25,8 +25,9 @@ open class FakeClassnameTags123API { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -34,7 +35,11 @@ open class FakeClassnameTags123API { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0e4ef7ffdf9..aea9263a7a5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -25,8 +25,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -34,7 +35,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -76,8 +81,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -85,7 +91,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -139,8 +149,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { + var task: URLSessionTask? return Future<[Pet], Error> { promise in - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -148,7 +159,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -194,8 +209,9 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { + var task: URLSessionTask? return Future<[Pet], Error> { promise in - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -203,7 +219,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -249,8 +269,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -258,7 +279,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -303,8 +328,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -312,7 +338,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -355,8 +385,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -364,7 +395,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -418,8 +453,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -427,7 +463,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -481,8 +521,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -490,7 +531,11 @@ open class PetAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 2e5cc6f0c37..e4a71a69dfd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -25,8 +25,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -34,7 +35,11 @@ open class StoreAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -75,8 +80,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { + var task: URLSessionTask? return Future<[String: Int], Error> { promise in - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -84,7 +90,11 @@ open class StoreAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -125,8 +135,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -134,7 +145,11 @@ open class StoreAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -176,8 +191,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -185,7 +201,11 @@ open class StoreAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 75a25afeec8..79cce70e949 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -25,8 +25,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -34,7 +35,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -73,8 +78,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -82,7 +88,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -120,8 +130,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -129,7 +140,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -167,8 +182,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -176,7 +192,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -218,8 +238,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -227,7 +248,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -269,8 +294,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body!)) @@ -278,7 +304,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -321,8 +351,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -330,7 +361,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif @@ -368,8 +403,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + var task: URLSessionTask? return Future { promise in - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -377,7 +413,11 @@ open class UserAPI { promise(.failure(error)) } } - }.eraseToAnyPublisher() + } + .handleEvents(receiveCancel: { + task?.cancel() + }) + .eraseToAnyPublisher() } #endif 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential 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 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { 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 43abbb33519..ac45c1f454b 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 @@ -19,8 +19,9 @@ 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) 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 063bcca0b8c..faaa1611c8f 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 @@ -19,8 +19,9 @@ 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 createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createXmlItemWithRequestBuilder(xmlItem: xmlItem).execute(apiResponseQueue) { result in + @discardableResult + open class func createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createXmlItemWithRequestBuilder(xmlItem: xmlItem).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -61,8 +62,9 @@ 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -102,8 +104,9 @@ 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -143,8 +146,9 @@ 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -184,8 +188,9 @@ 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -225,8 +230,9 @@ 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -267,8 +273,9 @@ 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -312,8 +319,9 @@ 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -368,8 +376,9 @@ 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -519,8 +528,9 @@ 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -588,8 +598,9 @@ 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -686,8 +698,9 @@ 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -738,8 +751,9 @@ 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 testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context).execute(apiResponseQueue) { result in + @discardableResult + open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) 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 34c654e4499..ac274a7c550 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 @@ -19,8 +19,9 @@ 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) 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 1aaff13713c..87aedd5c1a3 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 @@ -19,8 +19,9 @@ 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) 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 fbe47386f98..f2539226866 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 @@ -19,8 +19,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) 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 f61db9b14f2..3fc59f9ef4f 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 @@ -19,8 +19,9 @@ 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift index 4f921412e2b..b40334cece0 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 020b10a51d9..f838ced0df6 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ 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(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ 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(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 9f881ab2f41..0f5624f3e1f 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ 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(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 4087bbb1be3..26c12a61e64 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ 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(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -110,8 +112,9 @@ 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(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -155,8 +158,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -204,8 +208,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -250,8 +255,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -297,8 +303,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -342,8 +349,9 @@ 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, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 1049498918e..571d0564cef 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ internal class RequestBuilder { } } - internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } internal func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 81c4518c49e..f5d2ab74a2f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,8 +19,9 @@ internal class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index f7df9298d89..a5bf5a193ef 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,8 +18,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -59,8 +60,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -100,8 +102,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -141,8 +144,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -182,8 +186,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -224,8 +229,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -269,8 +275,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -325,8 +332,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, 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(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in + @discardableResult + internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, 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)) -> URLSessionTask? { + return testEndpointParametersWithRequestBuilder(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -476,8 +484,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -545,8 +554,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -600,8 +610,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ebbe6ed6889..e6f46831cf9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,8 +19,9 @@ internal class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 17abb526e9c..0441d91c094 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in + @discardableResult + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in + @discardableResult + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 4d59194aa02..111ce53225f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 19984b8c359..f8a4404579b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal 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 in + @discardableResult + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) 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 9a76a452f22..3046f05e3cd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +internal typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() internal class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - internal var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + internal var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { configuration. */ internal func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ internal class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ internal class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 7aa5118caff..d84e62c007e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,8 +19,9 @@ import AnyCodable - 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 328b2dca858..58208b46ee7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,8 +18,9 @@ import AnyCodable - 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -59,8 +60,9 @@ import AnyCodable - 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -100,8 +102,9 @@ import AnyCodable - 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -141,8 +144,9 @@ import AnyCodable - 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -182,8 +186,9 @@ import AnyCodable - 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -224,8 +229,9 @@ import AnyCodable - 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -269,8 +275,9 @@ import AnyCodable - 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -325,8 +332,9 @@ import AnyCodable - 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -476,8 +484,9 @@ import AnyCodable - 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -545,8 +554,9 @@ import AnyCodable - 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -600,8 +610,9 @@ import AnyCodable - 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ import AnyCodable - 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 85b43e2b291..153aaa15d8f 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,8 +19,9 @@ import AnyCodable - 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 715bf9df6c4..6ee48721751 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ import AnyCodable - 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ import AnyCodable - 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ import AnyCodable - 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ import AnyCodable - 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ import AnyCodable - 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ import AnyCodable - 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ import AnyCodable - 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ import AnyCodable - 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index dd6f0bb0ad2..c4c37878af9 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ import AnyCodable - 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ import AnyCodable - 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ import AnyCodable - 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ import AnyCodable - 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 5896d7ecb36..fc6c823089a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ import AnyCodable - 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ import AnyCodable - 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ import AnyCodable - 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ import AnyCodable - 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ import AnyCodable - 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ import AnyCodable - 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ import AnyCodable - 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ import AnyCodable - 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift index 04add0b222a..312ef272770 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift index e184995f52c..0fabebe6410 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift @@ -17,8 +17,9 @@ open class DefaultAPI { - 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 rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) { - rootGetWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) -> URLSessionTask? { + return rootGetWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 43abbb33519..ac45c1f454b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,8 +19,9 @@ 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 7f43de2f5ea..87d1539d825 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,8 +18,9 @@ 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -59,8 +60,9 @@ 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -100,8 +102,9 @@ 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -141,8 +144,9 @@ 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -182,8 +186,9 @@ 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -224,8 +229,9 @@ 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -269,8 +275,9 @@ 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -325,8 +332,9 @@ 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -476,8 +484,9 @@ 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -545,8 +554,9 @@ 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -600,8 +610,9 @@ 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 34c654e4499..ac274a7c550 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,8 +19,9 @@ 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 29d68b9f526..5c22a59a5c5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index fbe47386f98..f2539226866 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f61db9b14f2..3fc59f9ef4f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 4bb3249bda8..c097bc87b6e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -40,7 +40,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } 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 80ee4bc707a..1277c034392 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 @@ -19,8 +19,9 @@ 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: Swift.Result) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) 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 36f9d0bf137..2b796b1fd2f 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 @@ -18,8 +18,9 @@ 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: Swift.Result) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -59,8 +60,9 @@ 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: Swift.Result) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -100,8 +102,9 @@ 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: Swift.Result) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -141,8 +144,9 @@ 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: Swift.Result) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -182,8 +186,9 @@ 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: Swift.Result) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -224,8 +229,9 @@ 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: Swift.Result) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -269,8 +275,9 @@ 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: Swift.Result) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -325,8 +332,9 @@ 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: 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion(.success(())) @@ -476,8 +484,9 @@ 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: Swift.Result) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -545,8 +554,9 @@ 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: Swift.Result) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -600,8 +610,9 @@ 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: Swift.Result) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -643,8 +654,9 @@ 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: Swift.Result) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion(.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 ad810db3ec6..30d24c9a9e3 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 @@ -19,8 +19,9 @@ 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: Swift.Result) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) 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 f9dcab45b3f..a381d52b651 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 @@ -19,8 +19,9 @@ 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: Swift.Result) -> Void)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -65,8 +66,9 @@ 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: Swift.Result) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -123,8 +125,9 @@ 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: Swift.Result<[Pet], ErrorResponse>) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -223,8 +227,9 @@ 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: Swift.Result) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -272,8 +277,9 @@ 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: Swift.Result) -> Void)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -319,8 +325,9 @@ 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: Swift.Result) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -377,8 +384,9 @@ 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: Swift.Result) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -435,8 +443,9 @@ 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: Swift.Result) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) 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 3b20fcd01b0..66824247d0d 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 @@ -19,8 +19,9 @@ 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: Swift.Result) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -64,8 +65,9 @@ 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: Swift.Result<[String: Int], ErrorResponse>) -> Void)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], ErrorResponse>) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -109,8 +111,9 @@ 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: Swift.Result) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -155,8 +158,9 @@ 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: Swift.Result) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) 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 9dfe41e0605..799e257924d 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 @@ -19,8 +19,9 @@ 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: Swift.Result) -> Void)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -62,8 +63,9 @@ 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: Swift.Result) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -104,8 +106,9 @@ 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: Swift.Result) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -146,8 +149,9 @@ 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: Swift.Result) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -192,8 +196,9 @@ 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: Swift.Result) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -238,8 +243,9 @@ 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: Swift.Result) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(.success(response.body!)) @@ -285,8 +291,9 @@ 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: Swift.Result) -> Void)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) @@ -327,8 +334,9 @@ 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: Swift.Result) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion(.success(())) 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 829cf959b76..bc8aa33bf49 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -22,7 +22,7 @@ open class AnotherFakeAPI { */ open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -31,7 +31,10 @@ open class AnotherFakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9d0211f1186..2873a26ba83 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -21,7 +21,7 @@ open class FakeAPI { */ open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -30,7 +30,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -66,7 +69,7 @@ open class FakeAPI { */ open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -75,7 +78,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -111,7 +117,7 @@ open class FakeAPI { */ open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -120,7 +126,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -156,7 +165,7 @@ open class FakeAPI { */ open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -165,7 +174,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -201,7 +213,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -210,7 +222,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -247,7 +262,7 @@ open class FakeAPI { */ open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + let task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -256,7 +271,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -296,7 +314,7 @@ open class FakeAPI { */ open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -305,7 +323,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -356,7 +377,7 @@ open class FakeAPI { */ 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) -> Observable { return Observable.create { observer -> Disposable in - 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 in + let task = 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 in switch result { case .success: observer.onNext(()) @@ -365,7 +386,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -511,7 +535,7 @@ open class FakeAPI { */ 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) -> Observable { return Observable.create { observer -> Disposable in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + let task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -520,7 +544,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -584,7 +611,7 @@ open class FakeAPI { */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + let task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -593,7 +620,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -643,7 +673,7 @@ open class FakeAPI { */ open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + let task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -652,7 +682,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -690,7 +723,7 @@ open class FakeAPI { */ open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + let task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -699,7 +732,10 @@ open class FakeAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 22bb23afb48..cffcafcba69 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -22,7 +22,7 @@ open class FakeClassnameTags123API { */ open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -31,7 +31,10 @@ open class FakeClassnameTags123API { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index b9e23efd760..95d0a84b169 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -22,7 +22,7 @@ open class PetAPI { */ open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -31,7 +31,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -72,7 +75,7 @@ open class PetAPI { */ open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + let task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -81,7 +84,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -134,7 +140,7 @@ open class PetAPI { */ open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + let task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -143,7 +149,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -188,7 +197,7 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + let task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -197,7 +206,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -242,7 +254,7 @@ open class PetAPI { */ open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + let task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -251,7 +263,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -295,7 +310,7 @@ open class PetAPI { */ open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -304,7 +319,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -346,7 +364,7 @@ open class PetAPI { */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + let task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -355,7 +373,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -408,7 +429,7 @@ open class PetAPI { */ open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + let task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -417,7 +438,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -470,7 +494,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + let task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -479,7 +503,10 @@ open class PetAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 64965dcac0e..829ebefaa98 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -22,7 +22,7 @@ open class StoreAPI { */ open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -31,7 +31,10 @@ open class StoreAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -71,7 +74,7 @@ open class StoreAPI { */ open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { return Observable.create { observer -> Disposable in - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + let task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -80,7 +83,10 @@ open class StoreAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -120,7 +126,7 @@ open class StoreAPI { */ open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -129,7 +135,10 @@ open class StoreAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -170,7 +179,7 @@ open class StoreAPI { */ open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -179,7 +188,10 @@ open class StoreAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index e51f11a4951..f00d31a838b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -22,7 +22,7 @@ open class UserAPI { */ open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -31,7 +31,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -69,7 +72,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -78,7 +81,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -115,7 +121,7 @@ open class UserAPI { */ open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -124,7 +130,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -161,7 +170,7 @@ open class UserAPI { */ open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -170,7 +179,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -211,7 +223,7 @@ open class UserAPI { */ open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -220,7 +232,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -261,7 +276,7 @@ open class UserAPI { */ open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + let task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body!) @@ -270,7 +285,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -312,7 +330,7 @@ open class UserAPI { */ open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + let task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -321,7 +339,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } @@ -358,7 +379,7 @@ open class UserAPI { */ open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + let task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -367,7 +388,10 @@ open class UserAPI { } observer.onCompleted() } - return Disposables.create() + + return Disposables.create { + task?.cancel() + } } } 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 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 20147cf8c90..7759248e537 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -22,8 +22,9 @@ 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 4abbbfd3f37..016a94b531a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -21,8 +21,9 @@ 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -62,8 +63,9 @@ 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -103,8 +105,9 @@ 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -144,8 +147,9 @@ 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -185,8 +189,9 @@ 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -227,8 +232,9 @@ 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -272,8 +278,9 @@ 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -328,8 +335,9 @@ 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -479,8 +487,9 @@ 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -548,8 +557,9 @@ 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -603,8 +613,9 @@ 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -646,8 +657,9 @@ 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index f519e442ae4..f7968588367 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -22,8 +22,9 @@ 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 763e21a7dff..2bbb5aba079 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -22,8 +22,9 @@ 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -68,8 +69,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -126,8 +128,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -176,8 +179,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -226,8 +230,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -275,8 +280,9 @@ 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -322,8 +328,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -380,8 +387,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -438,8 +446,9 @@ 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 55d86dea71a..8c57ab94977 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -22,8 +22,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -67,8 +68,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -112,8 +114,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -158,8 +161,9 @@ 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 55da91b6376..90bc5143fa7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -22,8 +22,9 @@ 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -107,8 +109,9 @@ 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -149,8 +152,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -195,8 +199,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -241,8 +246,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -288,8 +294,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -330,8 +337,9 @@ 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8da1e4814ff..a7933c418ad 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -48,7 +48,10 @@ open class RequestBuilder { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { } + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 43abbb33519..ac45c1f454b 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,8 +19,9 @@ 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)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 7f43de2f5ea..87d1539d825 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,8 +18,9 @@ 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)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -59,8 +60,9 @@ 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)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -100,8 +102,9 @@ 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)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -141,8 +144,9 @@ 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)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -182,8 +186,9 @@ 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)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -224,8 +229,9 @@ 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)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -269,8 +275,9 @@ 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)) { - testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -325,8 +332,9 @@ 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)) { - 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 in + @discardableResult + 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)) -> URLSessionTask? { + return 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 in switch result { case .success: completion((), nil) @@ -476,8 +484,9 @@ 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)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -545,8 +554,9 @@ 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)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + @discardableResult + 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -600,8 +610,9 @@ 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)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -643,8 +654,9 @@ 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)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 34c654e4499..ac274a7c550 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,8 +19,9 @@ 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)) { - testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 29d68b9f526..5c22a59a5c5 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,8 +19,9 @@ 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)) { - addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -65,8 +66,9 @@ 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)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + @discardableResult + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -123,8 +125,9 @@ 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)) { - findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -173,8 +176,9 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -223,8 +227,9 @@ 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)) { - getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -272,8 +277,9 @@ 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)) { - updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -319,8 +325,9 @@ 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)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -377,8 +384,9 @@ 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)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -435,8 +443,9 @@ 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)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index fbe47386f98..f2539226866 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,8 +19,9 @@ 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)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -64,8 +65,9 @@ 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)) { - getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -109,8 +111,9 @@ 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)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -155,8 +158,9 @@ 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)) { - placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f61db9b14f2..3fc59f9ef4f 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,8 +19,9 @@ 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)) { - createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -62,8 +63,9 @@ 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)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -104,8 +106,9 @@ 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)) { - createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -146,8 +149,9 @@ 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)) { - deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -192,8 +196,9 @@ 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)) { - getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -238,8 +243,9 @@ 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)) { - loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -285,8 +291,9 @@ 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)) { - logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) @@ -327,8 +334,9 @@ 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)) { - updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: completion((), nil) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 762df8c3045..24ab89eda79 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -19,15 +19,26 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + // Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -47,12 +58,7 @@ open class URLSessionRequestBuilder: RequestBuilder { configuration. */ open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - let sessionDelegate = SessionDelegate() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + return defaultURLSession } /** @@ -93,11 +99,9 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { - let urlSessionId = UUID().uuidString - // Create a new manager for each request to customize its request header + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsupported Http method - \(method)") @@ -123,14 +127,17 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let cleanupRequest = { - urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() - urlSessionStore[urlSessionId] = nil - } - do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { @@ -159,13 +166,19 @@ open class URLSessionRequestBuilder: RequestBuilder { onProgressReady?(dataTask.progress) } + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + dataTask.resume() + return dataTask } catch { apiResponseQueue.async { - cleanupRequest() completion(.failure(ErrorResponse.error(415, nil, nil, error))) } + + return nil } } @@ -398,25 +411,20 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - +private class SessionDelegate: NSObject, URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? - if let taskDidReceiveChallenge = taskDidReceiveChallenge { + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) } else { if challenge.previousFailureCount > 0 { disposition = .rejectProtectionSpace } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) if credential != nil { disposition = .useCredential diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts index fe63a65b63b..1b493ddec45 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -551,6 +551,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -622,12 +628,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts index fe63a65b63b..1b493ddec45 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -551,6 +551,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -622,12 +628,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 867c9a3ea62..5da186643ad 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -515,6 +515,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -581,12 +587,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 867c9a3ea62..5da186643ad 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -515,6 +515,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -581,12 +587,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 867c9a3ea62..5da186643ad 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -515,6 +515,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -581,12 +587,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 867c9a3ea62..5da186643ad 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -515,6 +515,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -581,12 +587,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index 1f775776582..011ad69411b 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -573,6 +573,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -640,12 +646,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 56e0b0d6e06..fe9e0370398 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts index c22a87909bc..66ca7a9fbcc 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts index 8298d62d182..2a0f6ba3794 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts @@ -517,6 +517,12 @@ export class PetService { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -583,12 +589,21 @@ export class PetService { let localVarFormParams: { append(param: string, value: any): any; }; let localVarUseForm = false; let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; if (localVarUseForm) { localVarFormParams = new FormData(); } else { localVarFormParams = new HttpParams({encoder: this.encoder}); } + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index f3beaa1e976..b58e80a5b28 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -123,6 +123,6 @@ UTF-8 5.3.1-SNAPSHOT 1.0.0 - 4.8.1 + 4.13.2 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index b812ae69158..cdec3821859 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -309,7 +309,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index 24d7c0eb341..b33e0d64186 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -127,3 +129,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index bf885a5080c..dbeb9684fd3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -183,6 +183,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -306,5 +346,6 @@ 2.9.10 1.3.5 4.13.2 + 2.17.3 diff --git a/samples/openapi3/client/petstore/go/auth_test.go b/samples/openapi3/client/petstore/go/auth_test.go index aec544c2f26..c56d64e5e51 100644 --- a/samples/openapi3/client/petstore/go/auth_test.go +++ b/samples/openapi3/client/petstore/go/auth_test.go @@ -151,7 +151,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: TEST123") { + if !strings.Contains((string)(reqb), "api_key: TEST123") { t.Errorf("APIKey Authentication is missing") } @@ -186,7 +186,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + if !strings.Contains((string)(reqb), "api_key: Bearer TEST123") { t.Errorf("APIKey Authentication is missing") } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index c3ab7d2b8ec..99cd5b9ef28 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -327,7 +327,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index 79e4c46e4c3..c39ff494aa6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -125,3 +127,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index 744e22b67e3..8feb1611f5e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -183,6 +183,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -300,5 +340,6 @@ 0.2.1 1.3.5 4.13.2 + 2.17.3 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java index ca164bce114..c1f37a5acc4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java @@ -50,6 +50,8 @@ public class ChildSchema extends Parent { public static final String JSON_PROPERTY_PROP1 = "prop1"; private String prop1; + public ChildSchema() { + } public ChildSchema prop1(String prop1) { this.prop1 = prop1; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java index bbe43353af2..0bc65ec9d91 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java @@ -39,6 +39,8 @@ public class ChildSchemaAllOf { public static final String JSON_PROPERTY_PROP1 = "prop1"; private String prop1; + public ChildSchemaAllOf() { + } public ChildSchemaAllOf prop1(String prop1) { this.prop1 = prop1; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java index 18cb4e2b776..38dfaa71eac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -51,6 +51,8 @@ public class MySchemaNameCharacters extends Parent { public static final String JSON_PROPERTY_PROP2 = "prop2"; private String prop2; + public MySchemaNameCharacters() { + } public MySchemaNameCharacters prop2(String prop2) { this.prop2 = prop2; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java index 3e78f03ba54..966da5e7855 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java @@ -39,6 +39,8 @@ public class MySchemaNameCharactersAllOf { public static final String JSON_PROPERTY_PROP2 = "prop2"; private String prop2; + public MySchemaNameCharactersAllOf() { + } public MySchemaNameCharactersAllOf prop2(String prop2) { this.prop2 = prop2; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java index 008063a3805..dd8e55a9a24 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java @@ -49,6 +49,8 @@ public class Parent { public static final String JSON_PROPERTY_OBJECT_TYPE = "objectType"; private String objectType; + public Parent() { + } public Parent objectType(String objectType) { this.objectType = objectType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index dc5f013f2a8..6ffa4c5ad7a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' version = '1.0.0' @@ -11,6 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' } } @@ -129,3 +131,27 @@ dependencies { javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index fae535e28b0..0a3a077b03b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -183,6 +183,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -312,5 +352,6 @@ 4.13.2 1.7 8.3.1 + 2.17.3 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index f7badd84904..258bd1197b4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -74,6 +74,8 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; private Map mapWithUndeclaredPropertiesString = null; + public AdditionalPropertiesClass() { + } public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 0deb6741e6f..c5bd38a59e4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -53,6 +53,8 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal() { + } public Animal className(String className) { this.className = className; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index 1cfd08ffe54..e182ba4f7aa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -43,6 +43,8 @@ public class Apple { public static final String JSON_PROPERTY_ORIGIN = "origin"; private String origin; + public Apple() { + } public Apple cultivar(String cultivar) { this.cultivar = cultivar; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 3c7cee95f6d..a6364100b94 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -43,6 +43,8 @@ public class AppleReq { public static final String JSON_PROPERTY_MEALY = "mealy"; private Boolean mealy; + public AppleReq() { + } public AppleReq cultivar(String cultivar) { this.cultivar = cultivar; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5d3b478c12e..a6526e609cc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly() { + } public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b59275573c8..5fd34060846 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -42,6 +42,8 @@ public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; + public ArrayOfNumberOnly() { + } public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index db2613ad801..5a806551fb0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -50,6 +50,8 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; private List> arrayArrayOfModel = null; + public ArrayTest() { + } public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index 371ea4b7ab9..c40724818be 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -40,6 +40,8 @@ public class Banana { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; private BigDecimal lengthCm; + public Banana() { + } public Banana lengthCm(BigDecimal lengthCm) { this.lengthCm = lengthCm; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index dba6d385382..e999834dd83 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -44,6 +44,8 @@ public class BananaReq { public static final String JSON_PROPERTY_SWEET = "sweet"; private Boolean sweet; + public BananaReq() { + } public BananaReq lengthCm(BigDecimal lengthCm) { this.lengthCm = lengthCm; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java index 9463826bdb1..1bc43c34872 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -39,6 +39,8 @@ public class BasquePig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; + public BasquePig() { + } public BasquePig className(String className) { this.className = className; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index eea6cd4b4f0..370dc9ab8b9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -59,6 +59,8 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization() { + } public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index a7d98f00fcb..b99939ade45 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -49,6 +49,8 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat() { + } public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 298ba7d9b41..4b48d9f8587 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -39,6 +39,8 @@ public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf() { + } public CatAllOf declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 3addae65d9b..a9723092a95 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -43,6 +43,8 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category() { + } public Category id(Long id) { this.id = id; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index a42a9852dc0..7fcc5c6bc09 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -55,6 +55,8 @@ public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; private String petType = "ChildCat"; + public ChildCat() { + } public ChildCat name(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index e3c02bced78..76c51f86af8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -45,6 +45,8 @@ public class ChildCatAllOf { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; private String petType = "ChildCat"; + public ChildCatAllOf() { + } public ChildCatAllOf name(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 340fb74689a..d23f59f5935 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,6 +40,8 @@ public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel() { + } public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 2535057113d..99e45029b65 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -39,6 +39,8 @@ public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client() { + } public Client client(String client) { this.client = client; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 797a50b71e8..f0a582f87f2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -49,6 +49,8 @@ public class ComplexQuadrilateral { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; private String quadrilateralType; + public ComplexQuadrilateral() { + } public ComplexQuadrilateral shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java index eb8102dec28..6c7db8038ea 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -39,6 +39,8 @@ public class DanishPig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; + public DanishPig() { + } public DanishPig className(String className) { this.className = className; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java index bc4091db5a8..93297396653 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -41,6 +41,8 @@ public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public DeprecatedObject() { + } public DeprecatedObject name(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index da3756797ab..fdc8db5c411 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -49,6 +49,8 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog() { + } public Dog breed(String breed) { this.breed = breed; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index 06b4ea85759..43845b6171f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -39,6 +39,8 @@ public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf() { + } public DogAllOf breed(String breed) { this.breed = breed; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index eedf71283c3..9d7b7098479 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -65,6 +65,8 @@ public class Drawing { public static final String JSON_PROPERTY_SHAPES = "shapes"; private List shapes = null; + public Drawing() { + } public Drawing mainShape(Shape mainShape) { this.mainShape = mainShape; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index d381b594cb0..418e879befc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -115,6 +115,8 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; + public EnumArrays() { + } public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index aee1b8c5343..88c59517617 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -258,6 +258,8 @@ public class EnumTest { public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + public EnumTest() { + } public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 4f781725283..0e13e5eaebf 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -49,6 +49,8 @@ public class EquilateralTriangle { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; private String triangleType; + public EquilateralTriangle() { + } public EquilateralTriangle shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2673c8add96..575eaed95b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -45,6 +45,8 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; + public FileSchemaTestClass() { + } public FileSchemaTestClass file(java.io.File file) { this.file = file; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index 682c4206b17..2b341a4a261 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -39,6 +39,8 @@ public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; private String bar = "bar"; + public Foo() { + } public Foo bar(String bar) { this.bar = bar; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 79530fe5ecd..0575f277044 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -104,6 +104,8 @@ public class FormatTest { public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; private String patternWithDigitsAndDelimiter; + public FormatTest() { + } public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 259cebcbe31..7bac5a69e9e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -49,6 +49,8 @@ public class GrandparentAnimal { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; private String petType; + public GrandparentAnimal() { + } public GrandparentAnimal petType(String petType) { this.petType = petType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7bba0219b1c..9c1665a812b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -43,6 +43,18 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } /** * Get bar diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 479a14c09e7..151f8c89726 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -44,6 +44,8 @@ public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; private JsonNullable nullableMessage = JsonNullable.undefined(); + public HealthCheckResult() { + } public HealthCheckResult nullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 6fdfc79b241..f69147ae0a2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -40,6 +40,8 @@ public class InlineResponseDefault { public static final String JSON_PROPERTY_STRING = "string"; private Foo string; + public InlineResponseDefault() { + } public InlineResponseDefault string(Foo string) { this.string = string; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 9ee7887c89e..eb0448b30d1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -45,6 +45,8 @@ public class IsoscelesTriangle { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; private String triangleType; + public IsoscelesTriangle() { + } public IsoscelesTriangle shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 37569ca7505..1c862c16fb1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -89,6 +89,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; + public MapTest() { + } public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 41902730736..9b0e0f06add 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -53,6 +53,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass() { + } public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index fc03371ca82..0573efb7bd0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -44,6 +44,8 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response() { + } public Model200Response name(Integer name) { this.name = name; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84a4c7c8273..f2112a0d961 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -47,6 +47,8 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse() { + } public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 6c3ed4c8a61..57f315ddad8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,6 +40,8 @@ public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn() { + } public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 19cd2b35505..b9a4ee16408 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -52,6 +52,18 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } public Name name(Integer name) { this.name = name; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index de8f62c6667..e75b54179c5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -98,6 +98,8 @@ public class NullableClass { public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; private Map objectItemsNullable = null; + public NullableClass() { + } public NullableClass integerProp(Integer integerProp) { this.integerProp = JsonNullable.of(integerProp); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ed004b9d1f8..b2f8f39868e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -40,6 +40,8 @@ public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly() { + } public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index e21e20b2896..f781c008d84 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -55,6 +55,8 @@ public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_BARS = "bars"; private List bars = null; + public ObjectWithDeprecatedFields() { + } public ObjectWithDeprecatedFields uuid(String uuid) { this.uuid = uuid; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 303b6790843..2aa70c544d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -97,6 +97,8 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order() { + } public Order id(Long id) { this.id = id; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 1635472a57b..b09d4549256 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -48,6 +48,8 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite() { + } public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index 2e1e30212aa..80092aa8206 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -48,6 +48,8 @@ import org.openapitools.client.JSON; }) public class ParentPet extends GrandparentAnimal { + public ParentPet() { + } /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 8bfbc4dd265..33b08d3b60d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -100,6 +100,8 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet() { + } public Pet id(Long id) { this.id = id; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index c0af69c3574..38cf5200c90 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -39,6 +39,8 @@ public class QuadrilateralInterface { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; private String quadrilateralType; + public QuadrilateralInterface() { + } public QuadrilateralInterface quadrilateralType(String quadrilateralType) { this.quadrilateralType = quadrilateralType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index dd49c31a87f..9775939c277 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,6 +43,16 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } /** * Get bar diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 8c9b6b42ee0..143f82323c6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -49,6 +49,8 @@ public class ScaleneTriangle { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; private String triangleType; + public ScaleneTriangle() { + } public ScaleneTriangle shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index 9e58316126b..546a0473ab4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -39,6 +39,8 @@ public class ShapeInterface { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; private String shapeType; + public ShapeInterface() { + } public ShapeInterface shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index a20574fb628..61ae5941889 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -49,6 +49,8 @@ public class SimpleQuadrilateral { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; private String quadrilateralType; + public SimpleQuadrilateral() { + } public SimpleQuadrilateral shapeType(String shapeType) { this.shapeType = shapeType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 00f04d03418..981578922c9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -43,6 +43,8 @@ public class SpecialModelName { public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; private String specialModelName; + public SpecialModelName() { + } public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index d249df2c14b..9d81c6f11a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -43,6 +43,8 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag() { + } public Tag id(Long id) { this.id = id; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index 8e9ad3c3670..b5ea81f0f9a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -39,6 +39,8 @@ public class TriangleInterface { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; private String triangleType; + public TriangleInterface() { + } public TriangleInterface triangleType(String triangleType) { this.triangleType = triangleType; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index fceb70ecf5f..2dd037daceb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -87,6 +87,8 @@ public class User { public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; private JsonNullable anyTypePropNullable = JsonNullable.of(null); + public User() { + } public User id(Long id) { this.id = id; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 96f1a10f1a3..ee5e24a8bf8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -47,6 +47,8 @@ public class Whale { public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; + public Whale() { + } public Whale hasBaleen(Boolean hasBaleen) { this.hasBaleen = hasBaleen; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index 429cd7a96fb..5cb16abe582 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -84,6 +84,8 @@ public class Zebra { public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; + public Zebra() { + } public Zebra type(TypeEnum type) { this.type = type; diff --git a/samples/server/petstore/cpp-pistache/CMakeLists.txt b/samples/server/petstore/cpp-pistache/CMakeLists.txt index 992a04bf681..23269deb0ff 100644 --- a/samples/server/petstore/cpp-pistache/CMakeLists.txt +++ b/samples/server/petstore/cpp-pistache/CMakeLists.txt @@ -2,22 +2,23 @@ cmake_minimum_required (VERSION 3.2) project(api-server) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) include(ExternalProject) set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) ExternalProject_Add(PISTACHE - GIT_REPOSITORY https://github.com/oktal/pistache.git - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} + GIT_REPOSITORY https://github.com/pistacheio/pistache.git + BUILD_IN_SOURCE true + INSTALL_COMMAND meson setup build --prefix=${EXTERNAL_INSTALL_LOCATION} --libdir=lib && meson install -C build ) ExternalProject_Add(NLOHMANN GIT_REPOSITORY https://github.com/nlohmann/json.git - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} - + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DJSON_BuildTests=OFF ) + include_directories(${EXTERNAL_INSTALL_LOCATION}/include) link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index c3b19e937b7..6d9e331804c 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -128,11 +128,11 @@ void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request, // Getting the query params auto statusQuery = request.query().get("status"); - Pistache::Optional> status; - if(!statusQuery.isEmpty()){ + std::optional> status; + if(statusQuery.has_value()){ std::vector valueQuery_instance; - if(fromStringValue(statusQuery.get(), valueQuery_instance)){ - status = Pistache::Some(valueQuery_instance); + if(fromStringValue(statusQuery.value(), valueQuery_instance)){ + status = valueQuery_instance; } } @@ -158,11 +158,11 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P // Getting the query params auto tagsQuery = request.query().get("tags"); - Pistache::Optional> tags; - if(!tagsQuery.isEmpty()){ + std::optional> tags; + if(tagsQuery.has_value()){ std::vector valueQuery_instance; - if(fromStringValue(tagsQuery.get(), valueQuery_instance)){ - tags = Pistache::Some(valueQuery_instance); + if(fromStringValue(tagsQuery.value(), valueQuery_instance)){ + tags = valueQuery_instance; } } diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.h b/samples/server/petstore/cpp-pistache/api/PetApi.h index 408fbf9c7a0..b6aeb555c7a 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.h +++ b/samples/server/petstore/cpp-pistache/api/PetApi.h @@ -22,8 +22,8 @@ #include #include #include -#include +#include #include #include "ApiResponse.h" @@ -86,7 +86,7 @@ private: /// /// Pet id to delete /// (optional, default to "") - virtual void delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response) = 0; + virtual void delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response) = 0; /// /// Finds Pets by status /// @@ -94,7 +94,7 @@ private: /// Multiple status values can be provided with comma separated strings /// /// Status values that need to be considered for filter - virtual void find_pets_by_status(const Pistache::Optional> &status, Pistache::Http::ResponseWriter &response) = 0; + virtual void find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response) = 0; /// /// Finds Pets by tags /// @@ -102,7 +102,7 @@ private: /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Tags to filter by - virtual void find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response) = 0; + virtual void find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response) = 0; /// /// Find pet by ID /// diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.h b/samples/server/petstore/cpp-pistache/api/StoreApi.h index 39516e5c823..f6419da20f5 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.h +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.h @@ -22,8 +22,8 @@ #include #include #include -#include +#include #include #include "Order.h" diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index 2aff5aa9dda..43873a3d3fe 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -211,19 +211,19 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach // Getting the query params auto usernameQuery = request.query().get("username"); - Pistache::Optional username; - if(!usernameQuery.isEmpty()){ + std::optional username; + if(usernameQuery.has_value()){ std::string valueQuery_instance; - if(fromStringValue(usernameQuery.get(), valueQuery_instance)){ - username = Pistache::Some(valueQuery_instance); + if(fromStringValue(usernameQuery.value(), valueQuery_instance)){ + username = valueQuery_instance; } } auto passwordQuery = request.query().get("password"); - Pistache::Optional password; - if(!passwordQuery.isEmpty()){ + std::optional password; + if(passwordQuery.has_value()){ std::string valueQuery_instance; - if(fromStringValue(passwordQuery.get(), valueQuery_instance)){ - password = Pistache::Some(valueQuery_instance); + if(fromStringValue(passwordQuery.value(), valueQuery_instance)){ + password = valueQuery_instance; } } diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.h b/samples/server/petstore/cpp-pistache/api/UserApi.h index 76f3e55e43c..0c2fc319f57 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.h +++ b/samples/server/petstore/cpp-pistache/api/UserApi.h @@ -22,8 +22,8 @@ #include #include #include -#include +#include #include #include "User.h" @@ -118,7 +118,7 @@ private: /// /// The user name for login /// The password for login in clear text - virtual void login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response) = 0; + virtual void login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response) = 0; /// /// Logs out current logged in user session /// diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp index 94b49b151e4..b27e5d4d584 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp @@ -27,13 +27,13 @@ PetApiImpl::PetApiImpl(const std::shared_ptr& rtr) void PetApiImpl::add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::find_pets_by_status(const Pistache::Optional> &status, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h index 82c10b0a410..ba87dd0d7d6 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h @@ -24,10 +24,10 @@ #include #include #include +#include #include -#include #include "ApiResponse.h" #include "Pet.h" @@ -44,9 +44,9 @@ public: ~PetApiImpl() override = default; void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response); - void delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response); - void find_pets_by_status(const Pistache::Optional> &status, Pistache::Http::ResponseWriter &response); - void find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response); + void delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response); + void find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response); + void find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response); void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response); void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h index c5dda64490f..e9fec939ca2 100644 --- a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h @@ -24,10 +24,10 @@ #include #include #include +#include #include -#include #include "Order.h" #include diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp index b477f053c5c..252895e8d36 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp @@ -39,7 +39,7 @@ void UserApiImpl::delete_user(const std::string &username, Pistache::Http::Respo void UserApiImpl::get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h index 856a30db5bb..920d94846ed 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h @@ -24,10 +24,10 @@ #include #include #include +#include #include -#include #include "User.h" #include @@ -48,7 +48,7 @@ public: void create_users_with_list_input(const std::vector &body, Pistache::Http::ResponseWriter &response); void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); - void login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response); + void login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response); void logout_user(Pistache::Http::ResponseWriter &response); void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java index 8ac79a3055e..763058c7c84 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -142,6 +143,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index 819d8d21474..6f748228b87 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -2,6 +2,7 @@ package apimodels; import apimodels.Category; import apimodels.Tag; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; @@ -147,6 +148,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java index 13666218bd5..04bc408a7ca 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java @@ -2,6 +2,7 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; @@ -135,6 +136,7 @@ AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java index 6d027716816..421f34cf2dd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -181,6 +182,7 @@ public class Pet implements Serializable { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java index 4ed108d787e..4c0d02c16b9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -180,6 +181,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 6c89798b5ff..7162d94b3b8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -146,6 +147,7 @@ public enum StatusEnum { } @JsonProperty("photoUrls") + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 6c89798b5ff..7162d94b3b8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -146,6 +147,7 @@ public enum StatusEnum { } @JsonProperty("photoUrls") + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index 4ed108d787e..4c0d02c16b9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -180,6 +181,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index 4ed108d787e..4c0d02c16b9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -180,6 +181,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index 4ed108d787e..4c0d02c16b9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -180,6 +181,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index 4ed108d787e..4c0d02c16b9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -180,6 +181,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 082f75c0fe3..fa6c0b67ce5 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -6,19 +6,90 @@ import kotlinx.coroutines.flow.Flow; interface PetApiService { + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ suspend fun addPet(body: Pet): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ fun findPetsByStatus(status: kotlin.collections.List): Flow + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ fun findPetsByTags(tags: kotlin.collections.List): Flow + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ suspend fun getPetById(petId: kotlin.Long): Pet + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ suspend fun updatePet(body: Pet): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 5dbae34663c..1bc1ce9dc71 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -5,11 +5,45 @@ import kotlinx.coroutines.flow.Flow; interface StoreApiService { + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ suspend fun deleteOrder(orderId: kotlin.String): Unit + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ suspend fun getInventory(): Map + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ suspend fun getOrderById(orderId: kotlin.Long): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ suspend fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt index 475862547b5..90703434b3b 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -5,19 +5,84 @@ import kotlinx.coroutines.flow.Flow; interface UserApiService { + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ suspend fun createUser(body: User): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ suspend fun createUsersWithArrayInput(body: Flow): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ suspend fun createUsersWithListInput(body: Flow): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ suspend fun deleteUser(username: kotlin.String): Unit + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ suspend fun getUserByName(username: kotlin.String): User + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ suspend fun logoutUser(): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ suspend fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index b96e86aff1b..ee0e3bef83c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -5,19 +5,90 @@ import org.openapitools.model.Pet interface PetApiService { + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ fun addPet(body: Pet): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ fun findPetsByStatus(status: kotlin.collections.List): List + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ fun findPetsByTags(tags: kotlin.collections.List): List + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ fun getPetById(petId: kotlin.Long): Pet + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ fun updatePet(body: Pet): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index e67a66c4f7e..6de3e6cc1de 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,45 @@ import org.openapitools.model.Order interface StoreApiService { + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ fun deleteOrder(orderId: kotlin.String): Unit + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ fun getInventory(): Map + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ fun getOrderById(orderId: kotlin.Long): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index 40148efeb72..a1bcf6be237 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -4,19 +4,84 @@ import org.openapitools.model.User interface UserApiService { + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ fun createUser(body: User): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ fun createUsersWithArrayInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ fun createUsersWithListInput(body: kotlin.collections.List): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ fun deleteUser(username: kotlin.String): Unit + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ fun getUserByName(username: kotlin.String): User + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ fun logoutUser(): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION b/samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION index d509cc92aa8..4b448de535c 100644 --- a/samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION +++ b/samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1-SNAPSHOT \ No newline at end of file +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES index e9684d57948..3522987f15f 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES @@ -8,6 +8,6 @@ src/main/java/org/openapitools/api/TestHeadersApiController.java src/main/java/org/openapitools/api/TestQueryParamsApi.java src/main/java/org/openapitools/api/TestQueryParamsApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/TestResponse.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 57eeab68579..dfdd5db9095 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -42,15 +42,29 @@ public interface TestHeadersApi { * @param headerBoolean (optional, default to true) * @return default response (status code 200) */ + @ApiOperation(value = "test headers", nickname = "headersTest", notes = "desc", response = TestResponse.class, tags={ "verify-default-value", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "default response", response = TestResponse.class) }) @RequestMapping( method = RequestMethod.GET, value = "/test-headers", produces = { "application/json" } ) - default ResponseEntity headersTest(@ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false) BigDecimal headerNumber,@ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false) String headerString,@ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false) String headerStringWrapped,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false) String headerStringQuotes,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false) String headerStringQuotesWrapped,@ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false) Boolean headerBoolean) { + default ResponseEntity headersTest( +@ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false) BigDecimal headerNumber +, +@ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false) String headerString +, +@ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false) String headerStringWrapped +, +@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false) String headerStringQuotes +, +@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false) String headerStringQuotesWrapped +, +@ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false) Boolean headerBoolean +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index f722e3907ed..264c8c28f6a 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -42,15 +42,29 @@ public interface TestQueryParamsApi { * @param queryBoolean (optional, default to true) * @return default response (status code 200) */ + @ApiOperation(value = "test query params", nickname = "queryParamsTest", notes = "desc", response = TestResponse.class, tags={ "verify-default-value", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "default response", response = TestResponse.class) }) @RequestMapping( method = RequestMethod.GET, value = "/test-query-params", produces = { "application/json" } ) - default ResponseEntity queryParamsTest(@ApiParam(value = "", defaultValue = "11.2") @Valid @RequestParam(value = "queryNumber", required = false, defaultValue = "11.2") BigDecimal queryNumber,@ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryString", required = false, defaultValue = "qwerty") String queryString,@ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryStringWrapped", required = false, defaultValue = "qwerty") String queryStringWrapped,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotes,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotesWrapped,@ApiParam(value = "", defaultValue = "true") @Valid @RequestParam(value = "queryBoolean", required = false, defaultValue = "true") Boolean queryBoolean) { + default ResponseEntity queryParamsTest(@ApiParam(value = "", defaultValue = "11.2") @Valid @RequestParam(value = "queryNumber", required = false, defaultValue = "11.2") BigDecimal queryNumber + +,@ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryString", required = false, defaultValue = "qwerty") String queryString + +,@ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryStringWrapped", required = false, defaultValue = "qwerty") String queryStringWrapped + +,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotes + +,@ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotesWrapped + +,@ApiParam(value = "", defaultValue = "true") @Valid @RequestParam(value = "queryBoolean", required = false, defaultValue = "true") Boolean queryBoolean + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java index 765ab01a234..e7115a5f13b 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TestResponse */ diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..bd7100d9b55 --- /dev/null +++ b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml @@ -0,0 +1,170 @@ +openapi: 3.0.1 +info: + description: desc + title: toto + version: 1.0.0 +servers: +- description: / + url: / +tags: +- description: verify-default-value + name: verify-default-value +paths: + /test-headers: + get: + description: desc + operationId: headersTest + parameters: + - explode: false + in: header + name: headerNumber + required: false + schema: + default: 11.2 + type: number + style: simple + - explode: false + in: header + name: headerString + required: false + schema: + default: qwerty + type: string + style: simple + - explode: false + in: header + name: headerStringWrapped + required: false + schema: + default: qwerty + type: string + style: simple + - explode: false + in: header + name: headerStringQuotes + required: false + schema: + default: qwerty"with quotes" test + type: string + style: simple + - explode: false + in: header + name: headerStringQuotesWrapped + required: false + schema: + default: qwerty"with quotes" test + type: string + style: simple + - explode: false + in: header + name: headerBoolean + required: false + schema: + default: true + type: boolean + style: simple + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' + description: default response + summary: test headers + tags: + - verify-default-value + x-accepts: application/json + x-tags: + - tag: verify-default-value + /test-query-params: + get: + description: desc + operationId: queryParamsTest + parameters: + - explode: true + in: query + name: queryNumber + required: false + schema: + default: 11.2 + type: number + style: form + - explode: true + in: query + name: queryString + required: false + schema: + default: qwerty + type: string + style: form + - explode: true + in: query + name: queryStringWrapped + required: false + schema: + default: qwerty + type: string + style: form + - explode: true + in: query + name: queryStringQuotes + required: false + schema: + default: qwerty"with quotes" test + type: string + style: form + - explode: true + in: query + name: queryStringQuotesWrapped + required: false + schema: + default: qwerty"with quotes" test + type: string + style: form + - explode: true + in: query + name: queryBoolean + required: false + schema: + default: true + type: boolean + style: form + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' + description: default response + summary: test query params + tags: + - verify-default-value + x-accepts: application/json + x-tags: + - tag: verify-default-value +components: + schemas: + TestResponse: + example: + numberField: 6.027456183070403 + booleanField: true + id: 0 + stringField: asd + properties: + id: + type: integer + stringField: + default: asd + type: string + numberField: + default: 11 + type: number + booleanField: + default: true + type: boolean + required: + - booleanField + - id + - numberField + - stringField + type: object diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES index 4b0ad04efe4..830caed1ff1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 7bfeb18e407..3e2889541ec 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -37,8 +37,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -46,7 +48,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default CompletableFuture> call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default CompletableFuture> call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index bcfb69e6e42..032d332fcc1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -46,15 +46,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default CompletableFuture> createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default CompletableFuture> createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -67,15 +71,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default CompletableFuture> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default CompletableFuture> fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -88,15 +96,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default CompletableFuture> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default CompletableFuture> fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -120,15 +132,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default CompletableFuture> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default CompletableFuture> fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -141,15 +157,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default CompletableFuture> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default CompletableFuture> fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -162,15 +182,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default CompletableFuture> testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default CompletableFuture> testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -183,15 +207,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default CompletableFuture> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default CompletableFuture> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -204,8 +234,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -213,7 +245,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default CompletableFuture> testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default CompletableFuture> testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -251,19 +285,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default CompletableFuture> testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -284,16 +349,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default CompletableFuture> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default CompletableFuture> testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -311,14 +395,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default CompletableFuture> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default CompletableFuture> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -330,15 +428,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default CompletableFuture> testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default CompletableFuture> testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -351,15 +453,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default CompletableFuture> testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default CompletableFuture> testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -376,14 +484,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -397,12 +517,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -410,7 +532,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default CompletableFuture> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default CompletableFuture> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8e8a95a4a35..47e953b4e53 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -37,11 +37,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -49,7 +51,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default CompletableFuture> testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default CompletableFuture> testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 008d2277654..e977c20c3bf 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -39,20 +39,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default CompletableFuture> addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -66,19 +71,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -92,20 +104,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default CompletableFuture>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default CompletableFuture>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -136,20 +153,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -180,20 +202,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -224,22 +252,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default CompletableFuture> updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -253,19 +288,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -279,12 +322,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -292,7 +337,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 2c9d877db8c..da11e798ae1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -39,15 +39,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -59,11 +64,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -85,17 +92,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -124,16 +137,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default CompletableFuture> placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 085258b44f1..dd602ce66b5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -38,14 +38,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default CompletableFuture> createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default CompletableFuture> createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -57,14 +61,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default CompletableFuture> createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -76,14 +84,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default CompletableFuture> createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -97,15 +109,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -119,17 +136,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,16 +182,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default CompletableFuture> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default CompletableFuture> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -179,8 +209,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -201,15 +233,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES index 4b0ad04efe4..830caed1ff1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 2aeb64f71f2..c682b121c80 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) LocalDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) LocalDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 5edf1930936..fe9e7f727be 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index 13d2807b5f2..1eb518cb89d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 54dd2472e4c..04802633a42 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java index 8143e0e06a0..593ed335a0f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.LocalDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES index 4b0ad04efe4..830caed1ff1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 5e2cfca1ed1..c8793f61e44 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 5edf1930936..fe9e7f727be 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index ca35a4dabdb..54acb563336 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3b70a93bfb6..af849ea35e7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d0096c55cb1..e494b1b2c60 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 0815c5ab76d..00ab9b250fb 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 74abe89e2eb..7e78c62f6e1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 824a44a5570..d01dc2c8e74 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index cc8a8acc0d4..ef6da01824a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index fb81a46af40..13174a324c5 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java index 6c1b4f75d08..e61b1eb77b6 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 53289137ab6..96aec05a743 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f948c06157a..d15054d6291 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 809d131fca5..d6ac2177926 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java index de0fcc89cac..d2ece0d81f9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index c828f01f402..a280a3f6cdc 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 9dc3270d4e2..a064557cd58 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java index 94756b3484e..fc4ab35c4fa 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 9d4ec215e78..9a1f6caceff 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java index 7e0770622f4..250c280e8b1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 328bae149d1..24a57ea3f81 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java index 594c1b919fb..2b17053e1e6 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java index a252c04222c..e1f27783a59 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 9b41745ce15..05f26186f9a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 33ea41485bc..e8101183905 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index b3c09b9f30e..6dc082079cf 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -1,11 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 21c7724914f..20672ddb0ff 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 466c6f63c23..85e4c720017 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index ca910a4259b..0379f1c5c6e 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 105d23165aa..f4b869294be 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java index f7c77006924..feba6551cdb 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a7e614a25e2..abbc1403bb6 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 56d627978a9..513c6029234 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 9af9c13b906..8e712843796 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index ec3f1fc6b93..0c885910955 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java index 09c05ca6d10..5551de4c543 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 82239239bda..4f9793f1e12 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java index fdf2477970a..89be413bc21 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 0657c9fbe6a..e365d6f2f39 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 075522bdeff..41cfb97d1e6 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,11 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java index b6fcfa069d7..9c5a7d4617d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -12,9 +14,13 @@ import java.util.List; import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -164,6 +170,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 05ab3a4d0c7..f31a23539b9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index b3616c034ba..36c8e903bf4 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java index 053950ec28c..a6afe72ee64 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index ea87ce615dc..529910bf9e0 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 5acd9107750..6f9abf43c41 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java index 24c2f10976f..523bd496274 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java @@ -1,13 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 89c02b4307d..2eb5145f197 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES index a6fa9fcb33b..42cbca1ab18 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 6559197d2d2..8d805638e51 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 5c8251cd80e..a428ea5ba5e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -37,20 +37,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -64,19 +69,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -90,20 +102,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -132,20 +149,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -174,20 +196,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -216,22 +244,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,19 +280,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -271,12 +314,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -284,7 +329,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java index 7fb6b8e2ef6..db4f29350de 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 289be8925e1..729ef7defa5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..1cd65b8e95d --- /dev/null +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +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: http://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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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' + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/FILES b/samples/server/petstore/spring-mvc/.openapi-generator/FILES index 4b0ad04efe4..830caed1ff1 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 5e2cfca1ed1..c8793f61e44 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 5edf1930936..fe9e7f727be 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index bb049174195..6de38b1147e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31e2f5d206b..cacb0750801 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index aeb640876a2..84aa067c80d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 7b6f5ac16c7..afbcf499d33 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 49a6b9d4157..acc58a56a36 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 53421c6699f..be84ad677c5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 093f44e90bf..c9e823070d8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 60bb6561547..c62dc11f2ed 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java index 21643177b36..14f74376631 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 9fa32d2ea9c..61c61fc9199 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 7910abcc696..3ad7d2361f7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java index cb245ac0b60..4bfc2cfbb4d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java index b6edd21f6d9..ada0edb12a9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java index 8875754744f..461ed180406 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java index 0e18f88f386..437e279449e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java index 5f0126571a8..12ca73636c6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java index 6953a982a8a..bb4667b4e2c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java index 15d9b80c237..84099ff8042 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java index f1198fa1a3c..f74c32f05c7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java index 516c8671745..55fa62058c1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java index f81bd6fa78f..93c91767410 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java index cfedc80fa7e..025e4d7759b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java index 0fb3e144970..30fe225638e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java index 9575f4c28f3..2d83af41c8e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index b10549a9490..33ea4eacb0f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 2e1fa754045..9e9cec096d0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index 7ae4decd1d2..86d421a9d88 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e2a75a9f0e3..97d1a64a22d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java index 7e43d87491d..726c8b5fcf0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2cab02c3d08..b20b2dec727 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java index 90397952b59..f74c29e604c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java index 2850c513cfa..01d035fa32d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java index 37ab8e858d5..d17a0da84c8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java index 87bbf9823c3..c5882dc983a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java index 96b2bda9c40..fc212048b08 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java index a4575fdf1d8..ede10667c9d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java index 181c98b2b6d..0e0d3dc1c39 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java index aa1dd337f5d..e293d46d7b4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java index 06647f494bc..7f2bff42e91 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -165,6 +171,7 @@ public enum StatusEnum { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java index dc9812baee6..1ddffebe8f5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java index cf55f23775c..32a7f5a8851 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java index 8bc9dc399f8..96053497912 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java index 70f7a789f6b..91863ff730f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java index 56092259288..9d2b6059352 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java index 12737b21d29..3fa19e61270 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java index 75eb7b6f26d..5d477653f0c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 4bb76c23b2a..0616dc9030d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -18,7 +18,6 @@ src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index deee690e51e..9c4ef1f25e5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,8 +28,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -37,6 +39,8 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e22ac97a74a..ec32cf448bf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -40,7 +40,9 @@ public class AnotherFakeApiController implements AnotherFakeApi { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 496720406a5..e60e016dde5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -37,15 +37,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -55,15 +59,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -73,15 +81,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -91,15 +103,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,15 +125,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -127,15 +147,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -145,15 +169,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body); /** @@ -163,8 +193,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -172,7 +204,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); /** @@ -196,19 +230,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); + ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); /** @@ -226,16 +291,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); + ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); /** @@ -250,14 +334,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +); /** @@ -266,15 +364,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param); /** @@ -284,15 +386,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); + ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); /** @@ -306,14 +414,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +); /** @@ -324,12 +444,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -337,6 +459,12 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index ab53df36903..227840431fb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -49,7 +49,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +64,9 @@ public class FakeApiController implements FakeApi { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,7 +79,9 @@ public class FakeApiController implements FakeApi { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; @@ -95,7 +101,9 @@ public class FakeApiController implements FakeApi { * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -108,7 +116,9 @@ public class FakeApiController implements FakeApi { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -121,7 +131,9 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -134,7 +146,11 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -147,7 +163,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; @@ -181,7 +199,35 @@ public class FakeApiController implements FakeApi { * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + public ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -202,7 +248,23 @@ public class FakeApiController implements FakeApi { * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + public ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -220,7 +282,19 @@ public class FakeApiController implements FakeApi { * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -232,7 +306,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,7 +321,11 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + public ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -262,7 +342,17 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -276,7 +366,13 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7e5ee3ec69d..f552024c17c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -28,11 +28,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -40,6 +42,8 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 14b1f124d13..80e92bdeaf1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -40,7 +40,9 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 0220f86fc4b..c733126515f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -30,20 +30,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -54,19 +59,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -77,20 +89,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); + ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +); /** @@ -102,20 +119,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +); /** @@ -127,20 +149,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -152,22 +180,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -178,19 +213,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); /** @@ -201,12 +244,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -214,6 +259,12 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index f2945cc6db3..4905ee8920b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -42,7 +42,9 @@ public class PetApiController implements PetApi { * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,7 +58,11 @@ public class PetApiController implements PetApi { * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,7 +76,9 @@ public class PetApiController implements PetApi { * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -97,7 +105,9 @@ public class PetApiController implements PetApi { * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -124,7 +134,9 @@ public class PetApiController implements PetApi { * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -151,7 +163,9 @@ public class PetApiController implements PetApi { * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -165,7 +179,13 @@ public class PetApiController implements PetApi { * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -179,7 +199,13 @@ public class PetApiController implements PetApi { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index c905a265a54..ab7fee83406 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -30,15 +30,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +); /** @@ -47,11 +52,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -70,17 +77,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +); /** @@ -90,15 +103,20 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body); + ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 4e95605bddb..39221370982 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -42,7 +42,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -69,7 +71,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; @@ -94,7 +98,9 @@ public class StoreApiController implements StoreApi { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index d956508c479..dc48a09a50d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -29,14 +29,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body); + ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); /** @@ -45,14 +49,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -61,14 +69,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -79,15 +91,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -98,17 +115,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -119,16 +142,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -136,8 +166,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -155,14 +187,21 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 9f5ad372d5a..a749387b89f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -41,7 +41,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -53,7 +55,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,7 +69,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -79,7 +85,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -93,7 +101,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; @@ -119,7 +129,11 @@ public class UserApiController implements UserApi { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +159,11 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#updateUser */ - public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index ca35a4dabdb..66ec6689678 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3b70a93bfb6..aeb477e916f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d0096c55cb1..4631883198a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 70048242f0c..8b8eaffbe71 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 74abe89e2eb..30654d0bec8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 824a44a5570..1a2c2a018f1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index cc8a8acc0d4..4f14fb1747d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index fb81a46af40..3cbd66fa930 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 6c1b4f75d08..65534bbd4e3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cf1959a11e2..6366e913a32 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index ca0c1058d60..373e9f19c38 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 47de6885c4d..209d51c584d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.model.ReadOnlyFirst; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index de0fcc89cac..f0fa16873cb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.model.Cat; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index c828f01f402..a296dfc5819 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 9dc3270d4e2..638fd85562a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index 94756b3484e..f1a6ba0ecd8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.model.CatAllOf; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 9d4ec215e78..166fdfaf7c8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 7e0770622f4..3ca43362428 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 328bae149d1..314cec6e205 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 594c1b919fb..1853eeff5f0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index a252c04222c..e1d49d61348 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.model.DogAllOf; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 9b41745ce15..0249347555d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 775b965f064..2c22712b9ce 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index b3c09b9f30e..344a5cc7f8d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -1,11 +1,16 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 21c7724914f..47feac7def2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.model.OuterEnum; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 9d8809347cf..6bb5c5c059e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index fa93af8fcda..d7d44db402c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -13,6 +14,9 @@ import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 105d23165aa..055eaea6221 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index ef38614ddc7..777ec8f061f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import java.util.Map; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6e5065a7f04..31f0e9691e4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -14,6 +15,9 @@ import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 56d627978a9..a523a095a0d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 9af9c13b906..e2c8aca9fcc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index ec3f1fc6b93..2887e82ae24 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index 09c05ca6d10..e90e446667d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 82239239bda..e7453ce9262 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import java.math.BigDecimal; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 43f887d1fc2..d90339edc7e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 0657c9fbe6a..44d5a9dc16d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import java.math.BigDecimal; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 075522bdeff..214947f375c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,11 +1,16 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index aa1605a65d5..7c8eeae0204 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -15,6 +17,9 @@ import org.openapitools.model.Tag; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -164,6 +169,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 05ab3a4d0c7..af3367a7ffc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index b3616c034ba..6cde569d9c0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 053950ec28c..219b5ef9b87 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 029e340bfd6..5ddbf1ebca1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 0f0c046e1ca..ad778640909 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index 24c2f10976f..6e56bc32a2e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 48690657a23..621f973ebae 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index 61420a325e3..e4c32719b54 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 5e2cfca1ed1..c8793f61e44 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 5edf1930936..fe9e7f727be 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index 8c36406da48..9df6c44a321 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index ad1cdd44e49..2f58a11f22b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,8 +32,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -41,7 +43,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 3a1dbcdf0d1..82c6778214b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -41,15 +41,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return getDelegate().createXmlItem(xmlItem); } @@ -61,15 +65,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -81,15 +89,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -101,15 +113,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -121,15 +137,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return getDelegate().fakeOuterStringSerialize(body); } @@ -141,15 +161,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return getDelegate().testBodyWithFileSchema(body); } @@ -161,15 +185,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -181,8 +211,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -190,7 +222,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClientModel(body); } @@ -216,19 +250,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -248,16 +313,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -274,14 +358,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -292,15 +390,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return getDelegate().testInlineAdditionalProperties(param); } @@ -312,15 +414,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return getDelegate().testJsonFormData(param, param2); } @@ -336,14 +444,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -356,12 +476,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -369,7 +491,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1d3ed2c09ed..88b4da34518 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,11 +32,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -44,7 +46,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index dd7bf24b0e9..e57b00ff21e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -34,20 +34,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().addPet(body); } @@ -60,19 +65,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return getDelegate().deletePet(petId, apiKey); } @@ -85,20 +97,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { return getDelegate().findPetsByStatus(status); } @@ -112,20 +129,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { return getDelegate().findPetsByTags(tags); } @@ -139,20 +161,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { return getDelegate().getPetById(petId); } @@ -166,22 +194,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().updatePet(body); } @@ -194,19 +229,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -219,12 +262,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -232,7 +277,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 9b22b674ce8..6944e4129d3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -34,15 +34,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return getDelegate().deleteOrder(orderId); } @@ -53,11 +58,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -78,17 +85,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { return getDelegate().getOrderById(orderId); } @@ -100,16 +113,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 2865cfa269c..73a5817a302 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -33,14 +33,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return getDelegate().createUser(body); } @@ -51,14 +55,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithArrayInput(body); } @@ -69,14 +77,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithListInput(body); } @@ -89,15 +101,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return getDelegate().deleteUser(username); } @@ -110,17 +127,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { return getDelegate().getUserByName(username); } @@ -133,16 +156,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return getDelegate().loginUser(username, password); } @@ -152,8 +182,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -173,15 +205,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 8c36406da48..9df6c44a321 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index ad1cdd44e49..2f58a11f22b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,8 +32,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -41,7 +43,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 3a1dbcdf0d1..82c6778214b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -41,15 +41,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return getDelegate().createXmlItem(xmlItem); } @@ -61,15 +65,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -81,15 +89,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -101,15 +113,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -121,15 +137,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return getDelegate().fakeOuterStringSerialize(body); } @@ -141,15 +161,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return getDelegate().testBodyWithFileSchema(body); } @@ -161,15 +185,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -181,8 +211,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -190,7 +222,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClientModel(body); } @@ -216,19 +250,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -248,16 +313,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -274,14 +358,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -292,15 +390,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return getDelegate().testInlineAdditionalProperties(param); } @@ -312,15 +414,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return getDelegate().testJsonFormData(param, param2); } @@ -336,14 +444,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -356,12 +476,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -369,7 +491,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1d3ed2c09ed..88b4da34518 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,11 +32,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -44,7 +46,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index dd7bf24b0e9..e57b00ff21e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -34,20 +34,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().addPet(body); } @@ -60,19 +65,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return getDelegate().deletePet(petId, apiKey); } @@ -85,20 +97,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { return getDelegate().findPetsByStatus(status); } @@ -112,20 +129,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { return getDelegate().findPetsByTags(tags); } @@ -139,20 +161,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { return getDelegate().getPetById(petId); } @@ -166,22 +194,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().updatePet(body); } @@ -194,19 +229,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -219,12 +262,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -232,7 +277,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 9b22b674ce8..6944e4129d3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -34,15 +34,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return getDelegate().deleteOrder(orderId); } @@ -53,11 +58,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -78,17 +85,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { return getDelegate().getOrderById(orderId); } @@ -100,16 +113,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 2865cfa269c..73a5817a302 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -33,14 +33,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return getDelegate().createUser(body); } @@ -51,14 +55,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithArrayInput(body); } @@ -69,14 +77,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithListInput(body); } @@ -89,15 +101,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return getDelegate().deleteUser(username); } @@ -110,17 +127,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { return getDelegate().getUserByName(username); } @@ -133,16 +156,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return getDelegate().loginUser(username, password); } @@ -152,8 +182,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -173,15 +205,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 61420a325e3..e4c32719b54 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index b6205ac9a4f..d9f49716221 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) @@ -47,7 +49,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 94931c1b29b..19023bdba49 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -45,8 +45,10 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -55,7 +57,9 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -68,8 +72,10 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @ApiImplicitParams({ }) @@ -78,7 +84,9 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,8 +99,10 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @ApiImplicitParams({ }) @@ -101,7 +111,9 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -123,8 +135,10 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @ApiImplicitParams({ }) @@ -133,7 +147,9 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -146,8 +162,10 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @ApiImplicitParams({ }) @@ -156,7 +174,9 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -169,8 +189,10 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) @@ -179,7 +201,9 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -192,8 +216,10 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) @@ -202,7 +228,11 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -215,8 +245,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) @@ -226,7 +258,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -262,12 +296,15 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) @@ -276,7 +313,35 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -295,9 +360,12 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @ApiImplicitParams({ @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), @@ -308,7 +376,19 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters(@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -324,8 +404,10 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @ApiImplicitParams({ @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required = true, dataType = "Boolean", paramType = "header"), @@ -335,7 +417,15 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -347,8 +437,10 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -357,7 +449,9 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -370,8 +464,10 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -380,7 +476,11 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -397,8 +497,10 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) @@ -406,7 +508,17 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -420,12 +532,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @ApiImplicitParams({ }) @@ -435,7 +549,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e7ac69b818f..2b8723c03a0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) @@ -50,7 +52,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 491ec6135ed..06f331738cf 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -38,13 +38,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @ApiImplicitParams({ }) @@ -53,7 +56,9 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,13 +71,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @ApiImplicitParams({ @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") @@ -81,7 +89,9 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -95,13 +105,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @ApiImplicitParams({ }) @@ -110,7 +123,9 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -139,13 +154,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @ApiImplicitParams({ }) @@ -154,7 +172,9 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -183,13 +203,17 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @ApiImplicitParams({ }) @@ -198,7 +222,9 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -227,15 +253,20 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @ApiImplicitParams({ }) @@ -244,7 +275,9 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -258,12 +291,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @ApiImplicitParams({ }) @@ -272,7 +307,13 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -286,12 +327,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @ApiImplicitParams({ }) @@ -301,7 +344,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 11515193864..05e8b7e0dd5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -38,9 +38,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @ApiImplicitParams({ }) @@ -48,7 +51,9 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -60,11 +65,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiImplicitParams({ }) @@ -88,10 +95,14 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @ApiImplicitParams({ }) @@ -100,7 +111,9 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -127,9 +140,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @ApiImplicitParams({ }) @@ -138,7 +154,9 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 7f300c5944c..e25952fc528 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -37,8 +37,10 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -46,7 +48,9 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,8 +62,10 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -67,7 +73,9 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -79,8 +87,10 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -88,7 +98,9 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -102,9 +114,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) @@ -112,7 +127,9 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -126,10 +143,14 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) @@ -138,7 +159,9 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -166,9 +189,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiImplicitParams({ }) @@ -177,7 +203,11 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -188,8 +218,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) @@ -212,9 +244,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) @@ -222,7 +257,11 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index eac8acc70c6..22b53a2cd15 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().call123testSpecialTags(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 33806c07f99..3165448cc12 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default Mono> createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody Mono xmlItem, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().createXmlItem(xmlItem, exchange); } @@ -65,15 +69,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default Mono> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); } @@ -85,15 +93,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default Mono> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterCompositeSerialize(body, exchange); } @@ -105,15 +117,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default Mono> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterNumberSerialize(body, exchange); } @@ -125,15 +141,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default Mono> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterStringSerialize(body, exchange); } @@ -145,15 +165,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default Mono> testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testBodyWithFileSchema(body, exchange); } @@ -165,15 +189,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default Mono> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testBodyWithQueryParams(query, body, exchange); } @@ -185,8 +215,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -194,7 +226,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testClientModel(body, exchange); } @@ -220,19 +254,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) Flux binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) Flux binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); } @@ -252,16 +317,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); } @@ -278,14 +362,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } @@ -296,15 +394,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default Mono> testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> param, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Mono> param, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testInlineAdditionalProperties(param, exchange); } @@ -316,15 +418,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testJsonFormData(param, param2, exchange); } @@ -340,14 +448,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); } @@ -360,12 +480,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -373,7 +495,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) Flux requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) Flux requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9c32999e419..3db3fcc1911 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().testClassname(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 7dd9974e6cd..d06e0ed2db3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default Mono> addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().addPet(body, exchange); } @@ -64,19 +69,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default Mono> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().deletePet(petId, apiKey, exchange); } @@ -89,20 +101,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().findPetsByStatus(status, exchange); } @@ -116,20 +133,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().findPetsByTags(tags, exchange); } @@ -143,20 +165,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default Mono> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().getPetById(petId, exchange); } @@ -170,22 +198,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default Mono> updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().updatePet(body, exchange); } @@ -198,19 +233,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().updatePetWithForm(petId, name, status, exchange); } @@ -223,12 +266,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -236,7 +281,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default Mono> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) Flux file, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) Flux file, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 7ab1bc2282f..94ff763fd3b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default Mono> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().deleteOrder(orderId, exchange); } @@ -57,11 +62,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -82,17 +89,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().getOrderById(orderId, exchange); } @@ -104,16 +117,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default Mono> placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().placeOrder(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index e1f856d4a3f..e11a046eaf9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default Mono> createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUser(body, exchange); } @@ -55,14 +59,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default Mono> createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody Flux body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUsersWithArrayInput(body, exchange); } @@ -73,14 +81,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default Mono> createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody Flux body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUsersWithListInput(body, exchange); } @@ -93,15 +105,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default Mono> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().deleteUser(username, exchange); } @@ -114,17 +131,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default Mono> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().getUserByName(username, exchange); } @@ -137,16 +160,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default Mono> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().loginUser(username, password, exchange); } @@ -156,8 +186,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -177,15 +209,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default Mono> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { + default Mono> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody Mono body, @springfox.documentation.annotations.ApiIgnore final ServerWebExchange exchange) { return getDelegate().updateUser(username, body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index 5ed7c1bf68d..521670b5356 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -24,7 +24,6 @@ src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index deee690e51e..9c4ef1f25e5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,8 +28,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -37,6 +39,8 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 98cbe886cf6..30d4f1c90e3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -38,7 +38,9 @@ public class AnotherFakeApiController implements AnotherFakeApi { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return delegate.call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index ceeca9b3f1b..72b0473bb9c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -37,15 +37,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -55,15 +59,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -73,15 +81,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -91,15 +103,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,15 +125,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -127,15 +147,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -145,15 +169,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body); /** @@ -163,8 +193,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -172,7 +204,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); /** @@ -196,19 +230,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); + ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); /** @@ -226,16 +291,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); + ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); /** @@ -250,14 +334,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +); /** @@ -266,15 +364,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param); /** @@ -284,15 +386,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); + ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); /** @@ -306,14 +414,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +); /** @@ -324,12 +444,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -337,6 +459,12 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 8fc941c7545..e714970497e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -47,7 +47,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return delegate.createXmlItem(xmlItem); } @@ -59,7 +61,9 @@ public class FakeApiController implements FakeApi { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return delegate.fakeOuterBooleanSerialize(body); } @@ -71,7 +75,9 @@ public class FakeApiController implements FakeApi { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return delegate.fakeOuterCompositeSerialize(body); } @@ -83,7 +89,9 @@ public class FakeApiController implements FakeApi { * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return delegate.fakeOuterNumberSerialize(body); } @@ -95,7 +103,9 @@ public class FakeApiController implements FakeApi { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return delegate.fakeOuterStringSerialize(body); } @@ -107,7 +117,9 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return delegate.testBodyWithFileSchema(body); } @@ -119,7 +131,11 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return delegate.testBodyWithQueryParams(query, body); } @@ -131,7 +147,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return delegate.testClientModel(body); } @@ -157,7 +175,35 @@ public class FakeApiController implements FakeApi { * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + public ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -177,7 +223,23 @@ public class FakeApiController implements FakeApi { * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + public ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -194,7 +256,19 @@ public class FakeApiController implements FakeApi { * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -205,7 +279,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return delegate.testInlineAdditionalProperties(param); } @@ -217,7 +293,11 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + public ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return delegate.testJsonFormData(param, param2); } @@ -233,7 +313,17 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -246,7 +336,13 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7e5ee3ec69d..f552024c17c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -28,11 +28,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -40,6 +42,8 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e2e76a05e8c..027fe24ac12 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -38,7 +38,9 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return delegate.testClassname(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 86de7b07c56..3407bc13ba1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -29,20 +29,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -53,19 +58,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -76,20 +88,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -101,20 +118,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -126,20 +148,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -151,22 +179,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -177,19 +212,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); /** @@ -200,12 +243,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -213,6 +258,12 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 5b91410b451..79e735b977f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -39,7 +39,9 @@ public class PetApiController implements PetApi { * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return delegate.addPet(body); } @@ -52,7 +54,11 @@ public class PetApiController implements PetApi { * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return delegate.deletePet(petId, apiKey); } @@ -65,7 +71,9 @@ public class PetApiController implements PetApi { * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { + public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { return delegate.findPetsByStatus(status, pageable); } @@ -79,7 +87,9 @@ public class PetApiController implements PetApi { * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { return delegate.findPetsByTags(tags, pageable); } @@ -93,7 +103,9 @@ public class PetApiController implements PetApi { * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { return delegate.getPetById(petId); } @@ -107,7 +119,9 @@ public class PetApiController implements PetApi { * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return delegate.updatePet(body); } @@ -120,7 +134,13 @@ public class PetApiController implements PetApi { * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return delegate.updatePetWithForm(petId, name, status); } @@ -133,7 +153,13 @@ public class PetApiController implements PetApi { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { return delegate.uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index c905a265a54..ab7fee83406 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -30,15 +30,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +); /** @@ -47,11 +52,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -70,17 +77,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +); /** @@ -90,15 +103,20 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body); + ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index d662f858137..76d07f1fc78 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -40,7 +40,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return delegate.deleteOrder(orderId); } @@ -65,7 +67,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { return delegate.getOrderById(orderId); } @@ -77,7 +81,9 @@ public class StoreApiController implements StoreApi { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { return delegate.placeOrder(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index d956508c479..dc48a09a50d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -29,14 +29,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body); + ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); /** @@ -45,14 +49,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -61,14 +69,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -79,15 +91,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -98,17 +115,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -119,16 +142,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -136,8 +166,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -155,14 +187,21 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 642c9683055..da136ce2f80 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -39,7 +39,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return delegate.createUser(body); } @@ -50,7 +52,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return delegate.createUsersWithArrayInput(body); } @@ -61,7 +65,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return delegate.createUsersWithListInput(body); } @@ -74,7 +80,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return delegate.deleteUser(username); } @@ -87,7 +95,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { return delegate.getUserByName(username); } @@ -100,7 +110,11 @@ public class UserApiController implements UserApi { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return delegate.loginUser(username, password); } @@ -124,7 +138,11 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#updateUser */ - public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return delegate.updateUser(username, body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..46281c6456d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..474278b1b19 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..c670f89cdfc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 1e2c8c2726d..9f89c16c1bc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -13,6 +14,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..5ef4af43bbd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..95a74229727 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..9969c2fe720 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..757c0a536fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index 7fb6b8e2ef6..22249d7cc27 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 9c226efbbc4..995bebadda8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 51ea58aab38..922dc7a5666 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 1fea247ab3c..6937756d45c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..19ab1f8baff 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index b32ade55179..ebf9c7cec80 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..257322699ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index c79594679cf..3c2a6be2b25 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..4d88c1e45a8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index 72789665863..bb63f835363 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..21a27eb4e45 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..09bb08f9458 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 90d7bf130bb..14bf9e2c281 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..ed676c3662e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..3a9a9e85a8c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index a99196c2808..3d885b7876d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 8911b494fd5..7f83ebda6cb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -14,6 +15,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..a712d19243f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index b1d48c044ad..a4f10eadf35 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -13,6 +14,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 71693227fa7..b6607ec1de2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -15,6 +16,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..8e51dc7b0bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..1c50e0984df 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..f71f60f5970 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..8336bed2c94 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..87c0551edfc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index 06a8fdb8935..c03246a0acb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..34098a524fc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..33f64f0954e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 94dfc109a57..8e56b7045ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -14,6 +15,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..655154d2cf2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..beddd922ad4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..c7dba2565ee 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index bcf00b393fd..9dbb6eeeb09 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 2151f844f8e..998c11fb323 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..ac48b7bd3ac 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 9240d5345a6..fa83623c4bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..1cd65b8e95d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +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: http://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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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' + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES index 2bcd994d13a..31af355960d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -68,3 +67,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index ad1cdd44e49..2f58a11f22b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,8 +32,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -41,7 +43,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index a41ac72dafd..c090ac7835e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -41,15 +41,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return getDelegate().createXmlItem(xmlItem); } @@ -61,15 +65,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -81,15 +89,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -101,15 +113,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -121,15 +137,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return getDelegate().fakeOuterStringSerialize(body); } @@ -141,15 +161,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return getDelegate().testBodyWithFileSchema(body); } @@ -161,15 +185,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -181,8 +211,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -190,7 +222,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClientModel(body); } @@ -216,19 +250,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -248,16 +313,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -274,14 +358,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -292,15 +390,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return getDelegate().testInlineAdditionalProperties(param); } @@ -312,15 +414,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return getDelegate().testJsonFormData(param, param2); } @@ -336,14 +444,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -356,12 +476,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -369,7 +491,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1d3ed2c09ed..88b4da34518 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,11 +32,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -44,7 +46,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index 09d3446244a..0a6cbef0232 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -33,20 +33,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().addPet(body); } @@ -59,19 +64,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return getDelegate().deletePet(petId, apiKey); } @@ -84,20 +96,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { return getDelegate().findPetsByStatus(status, pageable); } @@ -111,20 +128,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { return getDelegate().findPetsByTags(tags, pageable); } @@ -138,20 +160,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { return getDelegate().getPetById(petId); } @@ -165,22 +193,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return getDelegate().updatePet(body); } @@ -193,19 +228,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -218,12 +261,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -231,7 +276,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 9b22b674ce8..6944e4129d3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -34,15 +34,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return getDelegate().deleteOrder(orderId); } @@ -53,11 +58,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -78,17 +85,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { return getDelegate().getOrderById(orderId); } @@ -100,16 +113,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 2865cfa269c..73a5817a302 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -33,14 +33,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return getDelegate().createUser(body); } @@ -51,14 +55,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithArrayInput(body); } @@ -69,14 +77,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithListInput(body); } @@ -89,15 +101,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return getDelegate().deleteUser(username); } @@ -110,17 +127,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { return getDelegate().getUserByName(username); } @@ -133,16 +156,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return getDelegate().loginUser(username, password); } @@ -152,8 +182,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -173,15 +205,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index 7fb6b8e2ef6..db4f29350de 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index 289be8925e1..729ef7defa5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..1cd65b8e95d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +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: http://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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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' + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index fce68c4e6a7..c314c6a9a0f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -18,7 +18,6 @@ src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index deee690e51e..9c4ef1f25e5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,8 +28,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -37,6 +39,8 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e22ac97a74a..ec32cf448bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -40,7 +40,9 @@ public class AnotherFakeApiController implements AnotherFakeApi { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index ceeca9b3f1b..72b0473bb9c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -37,15 +37,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -55,15 +59,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -73,15 +81,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -91,15 +103,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,15 +125,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -127,15 +147,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -145,15 +169,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body); /** @@ -163,8 +193,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -172,7 +204,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); /** @@ -196,19 +230,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); + ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback); /** @@ -226,16 +291,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); + ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString); /** @@ -250,14 +334,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +); /** @@ -266,15 +364,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param); /** @@ -284,15 +386,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); + ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2); /** @@ -306,14 +414,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +); /** @@ -324,12 +444,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -337,6 +459,12 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 99873d39bc3..34b4872f185 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -49,7 +49,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +64,9 @@ public class FakeApiController implements FakeApi { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,7 +79,9 @@ public class FakeApiController implements FakeApi { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; @@ -95,7 +101,9 @@ public class FakeApiController implements FakeApi { * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -108,7 +116,9 @@ public class FakeApiController implements FakeApi { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -121,7 +131,9 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -134,7 +146,11 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -147,7 +163,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; @@ -181,7 +199,35 @@ public class FakeApiController implements FakeApi { * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + public ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -202,7 +248,23 @@ public class FakeApiController implements FakeApi { * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + public ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -220,7 +282,19 @@ public class FakeApiController implements FakeApi { * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -232,7 +306,9 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,7 +321,11 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + public ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -262,7 +342,17 @@ public class FakeApiController implements FakeApi { * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -276,7 +366,13 @@ public class FakeApiController implements FakeApi { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7e5ee3ec69d..f552024c17c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -28,11 +28,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -40,6 +42,8 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body); + ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 14b1f124d13..80e92bdeaf1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -40,7 +40,9 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + public ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 86de7b07c56..3407bc13ba1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -29,20 +29,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -53,19 +58,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +); /** @@ -76,20 +88,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -101,20 +118,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); /** @@ -126,20 +148,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +); /** @@ -151,22 +179,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body); + ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); /** @@ -177,19 +212,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status); /** @@ -200,12 +243,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -213,6 +258,12 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 4d2e1b7626f..27bc49a0f61 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -41,7 +41,9 @@ public class PetApiController implements PetApi { * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -55,7 +57,11 @@ public class PetApiController implements PetApi { * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -69,7 +75,9 @@ public class PetApiController implements PetApi { * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { + public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -96,7 +104,9 @@ public class PetApiController implements PetApi { * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final Pageable pageable) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -123,7 +133,9 @@ public class PetApiController implements PetApi { * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -150,7 +162,9 @@ public class PetApiController implements PetApi { * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -164,7 +178,13 @@ public class PetApiController implements PetApi { * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -178,7 +198,13 @@ public class PetApiController implements PetApi { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index c905a265a54..ab7fee83406 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -30,15 +30,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +); /** @@ -47,11 +52,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -70,17 +77,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +); /** @@ -90,15 +103,20 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body); + ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 4e95605bddb..39221370982 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -42,7 +42,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -69,7 +71,9 @@ public class StoreApiController implements StoreApi { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; @@ -94,7 +98,9 @@ public class StoreApiController implements StoreApi { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index d956508c479..dc48a09a50d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -29,14 +29,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body); + ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); /** @@ -45,14 +49,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -61,14 +69,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body); /** @@ -79,15 +91,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +); /** @@ -98,17 +115,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username); + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +); /** @@ -119,16 +142,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +); /** @@ -136,8 +166,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -155,14 +187,21 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 9f5ad372d5a..a749387b89f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -41,7 +41,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -53,7 +55,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,7 +69,9 @@ public class UserApiController implements UserApi { * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -79,7 +85,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -93,7 +101,9 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; @@ -119,7 +129,11 @@ public class UserApiController implements UserApi { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + public ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +159,11 @@ public class UserApiController implements UserApi { * or User not found (status code 404) * @see UserApi#updateUser */ - public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..46281c6456d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..474278b1b19 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..c670f89cdfc 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 1e2c8c2726d..9f89c16c1bc 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -13,6 +14,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..5ef4af43bbd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..95a74229727 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..9969c2fe720 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..757c0a536fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index 7fb6b8e2ef6..22249d7cc27 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 9c226efbbc4..995bebadda8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 51ea58aab38..922dc7a5666 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 1fea247ab3c..6937756d45c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..19ab1f8baff 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index b32ade55179..ebf9c7cec80 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..257322699ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index c79594679cf..3c2a6be2b25 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..4d88c1e45a8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index 72789665863..bb63f835363 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..21a27eb4e45 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..09bb08f9458 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 90d7bf130bb..14bf9e2c281 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..ed676c3662e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..3a9a9e85a8c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index a99196c2808..3d885b7876d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 8911b494fd5..7f83ebda6cb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -14,6 +15,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..a712d19243f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index b1d48c044ad..a4f10eadf35 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -13,6 +14,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 71693227fa7..b6607ec1de2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -15,6 +16,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..8e51dc7b0bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..1c50e0984df 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..f71f60f5970 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..8336bed2c94 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..87c0551edfc 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index 06a8fdb8935..c03246a0acb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,6 +12,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..34098a524fc 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,6 +11,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..33f64f0954e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,17 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 94dfc109a57..8e56b7045ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -14,6 +15,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..655154d2cf2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..beddd922ad4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..c7dba2565ee 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index bcf00b393fd..9dbb6eeeb09 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 2151f844f8e..998c11fb323 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..ac48b7bd3ac 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,6 +10,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 9240d5345a6..fa83623c4bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,6 +13,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..1cd65b8e95d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +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: http://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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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' + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES index 0827a14791f..cc5174f019b 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -62,3 +61,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 6559197d2d2..8d805638e51 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 5c8251cd80e..a428ea5ba5e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -37,20 +37,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -64,19 +69,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -90,20 +102,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -132,20 +149,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + +, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -174,20 +196,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -216,22 +244,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,19 +280,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -271,12 +314,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -284,7 +329,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index 7fb6b8e2ef6..db4f29350de 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 289be8925e1..729ef7defa5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..1cd65b8e95d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +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: http://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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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' + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 61420a325e3..e4c32719b54 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index d343a51b490..0b1b0c6e1f5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index b6957a5d0ef..e2103efefa7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) Optional apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) Optional apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index 3a2d6eacf9d..0d1c364ddf2 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -3,7 +3,6 @@ pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java src/main/java/org/openapitools/virtualan/api/ApiUtil.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java src/main/java/org/openapitools/virtualan/model/User.java src/main/java/org/openapitools/virtualan/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 55a154596ca..f5194da5269 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -40,8 +40,10 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -49,7 +51,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 7531c82d60c..fa2be27a1eb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -49,15 +49,19 @@ public interface FakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -71,15 +75,19 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -93,15 +101,19 @@ public interface FakeApi { * @return Output composite (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -124,15 +136,19 @@ public interface FakeApi { * @return Output number (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -146,15 +162,19 @@ public interface FakeApi { * @return Output string (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -168,15 +188,19 @@ public interface FakeApi { * @return Success (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -190,15 +214,21 @@ public interface FakeApi { * @return Success (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -212,8 +242,10 @@ public interface FakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -221,7 +253,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -258,19 +292,50 @@ public interface FakeApi { * or User not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -292,16 +357,35 @@ public interface FakeApi { * or Not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -320,14 +404,28 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @ApiVirtual + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -340,15 +438,19 @@ public interface FakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -362,15 +464,21 @@ public interface FakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -388,14 +496,26 @@ public interface FakeApi { * @return Success (status code 200) */ @ApiVirtual + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -410,12 +530,14 @@ public interface FakeApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -423,7 +545,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 8171516cf82..65093bda6d5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -40,11 +40,13 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -52,7 +54,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 2a0981b466f..9fe808d5ec6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -42,20 +42,25 @@ public interface PetApi { * or Invalid input (status code 405) */ @ApiVirtual + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,19 +75,26 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @ApiVirtual + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,20 +109,25 @@ public interface PetApi { * or Invalid status value (status code 400) */ @ApiVirtual + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -140,20 +157,25 @@ public interface PetApi { * @deprecated */ @ApiVirtual + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -183,20 +205,26 @@ public interface PetApi { * or Pet not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -226,22 +254,29 @@ public interface PetApi { * or Validation exception (status code 405) */ @ApiVirtual + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -256,19 +291,27 @@ public interface PetApi { * @return Invalid input (status code 405) */ @ApiVirtual + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -283,12 +326,14 @@ public interface PetApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -296,7 +341,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 40218ddac64..4e0dbf7898c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -42,15 +42,20 @@ public interface StoreApi { * or Order not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,11 +68,13 @@ public interface StoreApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -90,17 +97,23 @@ public interface StoreApi { * or Order not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -128,16 +141,21 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @ApiVirtual + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index e05930eb96c..afe68f39f4d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -41,14 +41,18 @@ public interface UserApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,14 +65,18 @@ public interface UserApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -81,14 +89,18 @@ public interface UserApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -103,15 +115,20 @@ public interface UserApi { * or User not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -126,17 +143,23 @@ public interface UserApi { * or User not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -165,16 +188,23 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @ApiVirtual + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -186,8 +216,10 @@ public interface UserApi { * @return successful operation (status code 200) */ @ApiVirtual + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -209,15 +241,22 @@ public interface UserApi { * or User not found (status code 404) */ @ApiVirtual + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java index 53912aef870..22fa90b899c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java index 54c20bff237..83acca5c876 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java index d97294b5552..8d09220b9cb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index cf58358fe5f..d51807ac976 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java index fae7f353741..cac69369d0a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java index d794067a8ad..b58b9bc950c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java index 19a1cb20f05..67b8b985fed 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java index b39451f8a75..51c6a305466 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index 8bd774613ef..51c6715f728 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java index 9ae273ba4df..bafe2d77003 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index 796fe05be61..e7c79260c17 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index 2c0996a0f96..620e277c374 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.virtualan.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java index 6be0905eda7..4ed49f643a6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.virtualan.model.BigCatAllOf; import org.openapitools.virtualan.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java index d7809187f58..94323193320 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java index 203e488e0a7..d21f7764706 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java index 52d0d2e40be..395738af94c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.virtualan.model.Animal; import org.openapitools.virtualan.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java index bd739d71074..b0ad30eb11c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index f7ee48c8623..c626fa4b8cf 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java index 6e76f1d4433..cef8cd8b90a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java index d67f27ec39c..28b2c3b1b5f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java index efcab2e2ea0..8af075378f7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.virtualan.model.Animal; import org.openapitools.virtualan.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java index 3faa1dd56f5..678e4809263 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index e166cf59f7f..c2d6663545f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java index 02adc43755a..85be2a8ca87 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 20c6df50571..d27c78376ab 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.virtualan.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index 561455901ab..7000e76b90d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index fb66e37f30f..b17cb35148c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index 48053ce06ae..e74e246e1ee 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index 015d09ef65c..1aac4a7b761 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9ab1502ece7..3b7c1d6f066 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.virtualan.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index 015d939e442..d6ee65d5da4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index 773ae33fb65..7aa0db2e770 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index 94edc8e28b6..beccd82a057 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index 93032c7789e..09c2ff8ded9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java index 2701de1414a..ac7912f6bb3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java index 6b6992560bb..f7053b1ef4c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java index a7e770bcd01..654297922e7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java index ef0bba51c50..574ca853a37 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index bfcbcc44666..997db40fa47 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.virtualan.model.Category; import org.openapitools.virtualan.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java index 56fbcc79180..0da3f27957b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index 8623dccd79e..030ff057ae4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java index 24a53e73c9a..05f100a5113 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index cfe55efc337..603dceb1369 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index 9afbf2d5ed8..a8470a066d8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java index 35ca0d4cd1c..8232f1059a4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index 7535d477655..0a23cfea116 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.virtualan.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 61420a325e3..e4c32719b54 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 78af7f1960f..e11603b847c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,8 +36,10 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -45,7 +47,9 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 5e2cfca1ed1..c8793f61e44 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -45,15 +45,19 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem( + +@ApiParam(value = "XmlItem Body", required = true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,15 +70,19 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize( + +@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -87,15 +95,19 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize( + +@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -117,15 +129,19 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize( + +@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,15 +154,19 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize( + +@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -159,15 +179,19 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema( + +@ApiParam(value = "", required = true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,15 +204,21 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "", required = true) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query + +, + +@ApiParam(value = "", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -201,8 +231,10 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -210,7 +242,9 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -246,19 +280,50 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { + default ResponseEntity testEndpointParameters( + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + +@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + +@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + +@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + +@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + +@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + +@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary, + +@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date, + +@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime, + +@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + +@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -279,16 +344,35 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) @RequestMapping( method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { + default ResponseEntity testEnumParameters( +@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray +, +@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray + +,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger + +,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble + +, + +@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + +@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -306,14 +390,28 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup + +, +@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup +,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group + +,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup + +, +@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup +,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,15 +423,19 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties( + +@ApiParam(value = "request body", required = true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -346,15 +448,21 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { + default ResponseEntity testJsonFormData( + +@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + +@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,14 +479,26 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url + +,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -392,12 +512,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -405,7 +527,13 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c5f9f4b1000..3147f4bba9a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,11 +36,13 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -48,7 +50,9 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname(@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body) { + default ResponseEntity testClassname( + +@ApiParam(value = "client model", required = true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 5edf1930936..fe9e7f727be 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -38,20 +38,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity addPet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,19 +70,26 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + +, +@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,20 +103,25 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,20 +150,25 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -175,20 +197,26 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,22 +245,29 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet( + +@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,19 +281,27 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + +@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -272,12 +315,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping( method = RequestMethod.POST, @@ -285,7 +330,13 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + +, + +@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + +@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 2a0adcdf4d4..4ab75d5cfad 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -38,15 +38,20 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -58,11 +63,13 @@ public interface StoreApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping( method = RequestMethod.GET, @@ -84,17 +91,23 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,16 +134,21 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder( + +@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 62e1bfa86d5..dabb11d3364 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -37,14 +37,18 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user" ) - default ResponseEntity createUser(@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity createUser( + +@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,14 +60,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" ) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -75,14 +83,18 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" ) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput( + +@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,15 +108,20 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -118,17 +135,23 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + +) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,16 +179,23 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username + +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + +) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,8 +206,10 @@ public interface UserApi { * * @return successful operation (status code 200) */ + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, @@ -198,15 +230,22 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" ) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username + +, + +@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8c7e00956c3..847d9f37777 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesAnyType */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 864299cf9b2..31b7fad0c94 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesArray */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index b445c7bb0d8..5c23bc8d768 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesBoolean */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 76a9f4e4c25..82d25ab6e74 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 089c1edce9d..802674f7820 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesInteger */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index f2f8fe6949b..787a4262026 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesNumber */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index bcca31ee32a..271b66cf682 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesObject */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 829ea052d3e..08ba6bfe63c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * AdditionalPropertiesString */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java index 1319038cccc..7598b6f5561 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Animal */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aec96b23f03..bf1b74e83fc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 63a657c8ddd..f1ced8ef71a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java index 2a36629dfc7..81c7ab3dd78 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ArrayTest */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java index c7912d432b7..1835c7bf211 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCat */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java index aba5eb47270..43555f5bfed 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * BigCatAllOf */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java index 587443bb766..2ccf1e812e5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Capitalization */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java index b32ade55179..0876d9f30a0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Cat */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java index ce9d21ae5ec..d59a3783d0a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * CatAllOf */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index c79594679cf..ef9a938298b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Category */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java index a462f09a9cb..af4c7442312 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java index 72789665863..298c69c03b1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Client */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java index 229b97f2a7c..09938cd0f5f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Dog */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java index 29b736410b7..d95ac4a329d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * DogAllOf */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java index ec2d4e1ce8b..beeff77d9e5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumArrays */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f..8f82b2f7843 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index f9b00d90ed5..0ce7ab0f2fa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * EnumTest */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8e4f8d5d5d9..ea5aa826feb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FileSchemaTestClass */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index 091f7d97f2b..352d758ce6e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -11,9 +12,13 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * FormatTest */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2dd77785ad5..10e514bb172 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java index 7b9a321ecb2..36754fec8c9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -10,9 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MapTest */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d80573256c6..8238e3227a6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -12,9 +13,13 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java index 3f2d0da5f33..3f8bdc54450 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ec7ccfe141..99a06748ac1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java index 5d0c266a148..d9cc6193aee 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java index 3cc5bf64c06..880351d2843 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Model for testing model name same as property name */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java index c1cafb126be..4af42224ae5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * NumberOnly */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 0c9dddf85da..ba0b3b2e313 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -8,9 +9,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Order */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java index 7425f5c7589..cdac99f37e4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -7,9 +8,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * OuterComposite */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b0..d74006b9d33 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java @@ -1,12 +1,18 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 5f44cab5669..9aa5cb53c51 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -1,9 +1,11 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -13,9 +15,13 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Pet */ @@ -162,6 +168,7 @@ public class Pet { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6f4a25b65ef..f872289b8da 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java index 16e690b5740..31cc434cd51 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 9306b226ea5..2d1ac94412f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * Tag */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java index 80788f31612..fb29f038fc6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderDefault */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java index 963c3c66b57..096b4ada099 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * TypeHolderExample */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index 4a0c635f1ad..3cadd5d4ec5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -1,14 +1,19 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * User */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java index 465b94b6a88..62cfbcc6b28 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -9,9 +10,13 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; + +import java.util.*; + /** * XmlItem */ diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..d6386dc39bf --- /dev/null +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + 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 + x-tags: + - tag: store + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /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 + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + 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 + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + 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 + x-tags: + - tag: user + /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 + x-tags: + - tag: fake_classname_tags 123#$%^ + /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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + 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 + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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: '*/*' + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: $another-fake? + /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 + x-tags: + - tag: fake + /fake/test-query-parameters: + 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 + x-tags: + - tag: fake + /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 + x-tags: + - tag: pet +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 + uniqueItems: true + 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 + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 5e114596222..6c8d8667df5 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -73,6 +73,11 @@ image: "img/companies/boxever.svg" infoLink: "https://www.boxever.com/" pinned: false +- + caption: Bunker Holding Group + image: "img/companies/bunker-holding.png" + infoLink: "https://www.bunker-holding.com/" + pinned: false - caption: "California State University, Northridge" image: "img/companies/CSUNS.png" diff --git a/website/static/img/companies/bunker-holding.png b/website/static/img/companies/bunker-holding.png new file mode 100644 index 00000000000..de849d342fd Binary files /dev/null and b/website/static/img/companies/bunker-holding.png differ diff --git a/website/yarn.lock b/website/yarn.lock index 1dd6b0b5bd4..23846922dea 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -3151,9 +3151,9 @@ dns-equal@^1.0.0: integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= dns-packet@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" - integrity sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg== + version "1.3.4" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f" + integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA== dependencies: ip "^1.1.0" safe-buffer "^5.0.1" @@ -3708,9 +3708,9 @@ feed@^4.0.0: xml-js "^1.6.11" figgy-pudding@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" - integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== + version "3.5.2" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" + integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== figures@^2.0.0: version "2.0.0" @@ -8488,9 +8488,9 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" - integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + version "6.0.2" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" + integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== dependencies: figgy-pudding "^3.5.1"