diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 430b0ea815ce880c77a6f202f1d900c78eb12509..56992b9811e0ac3a41a63bbb09b28a454c5102c1 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -26,6 +26,7 @@ jobs: - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: ${{ matrix.java }} - uses: actions/cache@v2.1.5 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 98f191f2c9c0dd230c1c97ebbb09df6ed5d80f09..d991e052a7d61b77f91274bb0dd8bfaed988dc87 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -16,6 +16,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: 11 - name: Compile with Maven run: mvn -B -q clean install jacoco:report diff --git a/README.md b/README.md index c994f615fa62bd604c2a7627de26cf41cfb00a07..724c9da27711470097b2786a0cf70b35284ec212 100644 --- a/README.md +++ b/README.md @@ -9,27 +9,17 @@ <div align="center"> -[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.1.1`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.2.0`): [](https://travis-ci.org/OpenAPITools/openapi-generator) [](https://circleci.com/gh/OpenAPITools/openapi-generator) -[](https://app.shippable.com/github/OpenAPITools/openapi-generator) [](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [](https://cloud.drone.io/OpenAPITools/openapi-generator) [](https://app.bitrise.io/app/4a2b10a819d12b67) [](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22) -[5.2.x](https://github.com/OpenAPITools/openapi-generator/tree/5.2.x) (`5.2.x`): -[](https://travis-ci.org/OpenAPITools/openapi-generator) -[](https://circleci.com/gh/OpenAPITools/openapi-generator) -[](https://app.shippable.com/github/OpenAPITools/openapi-generator) -[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) -[](https://cloud.drone.io/OpenAPITools/openapi-generator) -[](https://app.bitrise.io/app/4a2b10a819d12b67) - [6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`): [](https://travis-ci.org/OpenAPITools/openapi-generator) [](https://circleci.com/gh/OpenAPITools/openapi-generator) -[](https://app.shippable.com/github/OpenAPITools/openapi-generator) [](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [](https://cloud.drone.io/OpenAPITools/openapi-generator) [](https://app.bitrise.io/app/4a2b10a819d12b67) @@ -120,9 +110,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI Generator Version | Release Date | Notes | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | | 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Nov/Dec 2021 | Minor release with breaking changes (no fallback) | -| 5.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.2.0-SNAPSHOT/) | May/Jun 2021 | Minor release with breaking changes (with fallback) | -| 5.1.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.1.1-SNAPSHOT/) | Apr/May 2021 | Patch release (enhancements, bug fixes, etc) | -| [5.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.1.0) (latest stable release) | 20.03.2021 | Minor release with breaking changes (with fallback) | +| 5.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.2.0-SNAPSHOT/) | Jun/Jul 2021 | Minor release with breaking changes (with fallback) | +| [5.1.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.1.1) (latest stable release) | 07.05.2021 | Patch release (enhancements, bug fixes, etc) | | [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) | OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -179,16 +168,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. <!-- RELEASE_VERSION --> If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -413,7 +402,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 5.1.0 +openapi-generator-cli version-manager set 5.1.1 ``` Or install it as dev-dependency: @@ -437,7 +426,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) <!-- RELEASE_VERSION --> -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar) <!-- /RELEASE_VERSION --> To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` diff --git a/bin/configs/python-oas2.yaml b/bin/configs/python-oas2.yaml index 4555376bd1672a6cccc65c72b3a27ff490c07049..7c548fb392697001a64cdd925245bbfb8c83d7c3 100644 --- a/bin/configs/python-oas2.yaml +++ b/bin/configs/python-oas2.yaml @@ -1,7 +1,10 @@ +# this file exists because in this file we omit setting disallowAdditionalPropertiesIfNotPresent +# which makes it default to false +# that false setting is needed for composed schemas to work +# Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword. generatorName: python outputDir: samples/client/petstore/python inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: - disallowAdditionalPropertiesIfNotPresent: "true" packageName: petstore_api diff --git a/bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml b/bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml new file mode 100644 index 0000000000000000000000000000000000000000..841cf77854eb5f871285a0a0ad29cc0f79329c38 --- /dev/null +++ b/bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml @@ -0,0 +1,7 @@ +generatorName: python +outputDir: samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent +inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + disallowAdditionalPropertiesIfNotPresent: "true" + packageName: petstore_api diff --git a/docs/generators.md b/docs/generators.md index 521bdc3dbf0e98bb6102e5ffc74cc4b3e2dfa906..6cb063b22308aa4e55c263c792e60f528eddec8a 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -106,6 +106,7 @@ The following generators are available: * [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md) * [jaxrs-spec](generators/jaxrs-spec.md) * [kotlin-server](generators/kotlin-server.md) +* [kotlin-server-deprecated (deprecated)](generators/kotlin-server-deprecated.md) * [kotlin-spring](generators/kotlin-spring.md) * [kotlin-vertx (beta)](generators/kotlin-vertx.md) * [nodejs-express-server (beta)](generators/nodejs-express-server.md) diff --git a/docs/generators/README.md b/docs/generators/README.md index 6510770e47a901966fd80085a680043b2d79cbd8..a8ac9c9310c31f07c7d5b28a2b72e170eed2fa4a 100644 --- a/docs/generators/README.md +++ b/docs/generators/README.md @@ -91,6 +91,7 @@ The following generators are available: * [jaxrs-resteasy-eap](jaxrs-resteasy-eap.md) * [jaxrs-spec](jaxrs-spec.md) * [kotlin-server](kotlin-server.md) +* [kotlin-server-deprecated](kotlin-server-deprecated.md) * [kotlin-spring](kotlin-spring.md) * [kotlin-vertx (beta)](kotlin-vertx.md) * [nodejs-express-server (beta)](nodejs-express-server.md) diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md new file mode 100644 index 0000000000000000000000000000000000000000..5499354747c52d60c3ea566c2f21ae35ab3757f4 --- /dev/null +++ b/docs/generators/kotlin-server-deprecated.md @@ -0,0 +1,214 @@ +--- +title: Config Options for kotlin-server-deprecated +sidebar_label: kotlin-server-deprecated +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|apiSuffix|suffix for api classes| |Api| +|artifactId|Generated artifact id (name of jar).| |kotlin-server-deprecated| +|artifactVersion|Generated artifact's package version.| |1.0.0| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true| +|featureCORS|Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org.| |false| +|featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true| +|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| +|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd></dl>|ktor| +|modelMutable|Create mutable models| |false| +|packageName|Generated artifact package name.| |org.openapitools.server| +|parcelizeModels|toggle "@Parcelize" for generated models| |null| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |null| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|BigDecimal|java.math.BigDecimal| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|kotlin.collections.ArrayList| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| + + +## LANGUAGE PRIMITIVES + +<ul class="column-ul"> +<li>kotlin.Array</li> +<li>kotlin.Boolean</li> +<li>kotlin.Byte</li> +<li>kotlin.ByteArray</li> +<li>kotlin.Char</li> +<li>kotlin.Double</li> +<li>kotlin.Float</li> +<li>kotlin.Int</li> +<li>kotlin.Long</li> +<li>kotlin.Short</li> +<li>kotlin.String</li> +<li>kotlin.collections.List</li> +<li>kotlin.collections.Map</li> +<li>kotlin.collections.Set</li> +</ul> + +## RESERVED WORDS + +<ul class="column-ul"> +<li>as</li> +<li>break</li> +<li>class</li> +<li>continue</li> +<li>do</li> +<li>else</li> +<li>false</li> +<li>for</li> +<li>fun</li> +<li>if</li> +<li>in</li> +<li>interface</li> +<li>is</li> +<li>null</li> +<li>object</li> +<li>package</li> +<li>return</li> +<li>super</li> +<li>this</li> +<li>throw</li> +<li>true</li> +<li>try</li> +<li>typealias</li> +<li>typeof</li> +<li>val</li> +<li>var</li> +<li>when</li> +<li>while</li> +</ul> + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index ecaf99a294f2219522ef10ac0ee78e25422061f6..b45dc3ffb4d2c544ceec8787b606c1424af9c528 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true| |featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| |featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true| +|featureLocations|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd></dl>|ktor| |modelMutable|Create mutable models| |false| diff --git a/docs/generators/python.md b/docs/generators/python.md index 4cf503ff2786431be90bc4c69ff9b236c0cee650..fe60f0e511c71862daa857c4d88b1d8f2922cfdd 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -7,6 +7,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: this option breaks composition and will be removed in 6.0.0</dd></dl>|false| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| @@ -28,7 +29,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Instantiated By | | ---------- | --------------- | -|map|dict| ## LANGUAGE PRIMITIVES diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 58be25191edbac4b0986426cf82fb033e3612d1e..fb3c5139b0e3869498d05071535a2c83cf787d36 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-project</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index d64cb848dd0cd70b53920beacc73271c7461140f..dc964764aa686ba020f11b43b0803eea0032055f 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ <artifactId>openapi-generator-project</artifactId> <groupId>org.openapitools</groupId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 8f1066a02dc90c4b5356dc8b7e59cd385f4aaba9..01c9f563508ec02c8c900128d77c169c4a95c76b 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.1.1 +openApiGeneratorVersion=5.2.0-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index b017790425e2ab29879acbae30505d7e0329595d..fc856601f6717dd00a0ee383fa5ec47827a81163 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-project</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> 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 589e91215782aac3d281363772ee7332fae888df..8b65b3b4572dcc49e8eeccdae211b328a726fe62 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.1.1-SNAPSHOT +openApiGeneratorVersion=5.2.0-SNAPSHOT # /RELEASE_VERSION diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 4dbd2ad7aef894f0c58e22cf55054e47a327fdd3..fb7e9a810c3dd016d7888e1ba9bffb32245c213b 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <executions> <execution> diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index f501797cec6269e61ecafc5f1f24d7916824ca24..d6ddeeb890dbb5a0052bc45a0d7c844ba4d99bda 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -15,7 +15,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1-SNAPSHOT</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <executions> <execution> diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index ded5be470f259f846998921793a708a1be9fad20..b2a3696e1c0865826a9c4148ab111310dcc62bfd 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <dependencies> <dependency> diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index 06b66510d3d41c0f2f91e7b6d54e3cf195766614..f3ef4ff8d49c92e39731955f27e71535cae4fdd0 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <executions> <execution> diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index dd73d6d13de2d91daa6cec646b90830b3b5595b3..1f18f87d755338a65134414aeb131293a1d9b936 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <executions> <execution> diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index 538b3a1f3d0386c1d90e73779b1aad41756bb7d7..c0932d04dd091b51eaeddaf85dd71ab8437dce77 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1-SNAPSHOT</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <executions> <execution> diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 8853a970f3282733e81fa303709a431db5c7dd02..f58c7f17bcd1233377b7a1414b5d8df00c39900e 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-project</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index cb080960aafe4d287994b17311b577000f482830..eff136ed4a376f791cc811ce618d5ba60e5db1e4 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-project</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index c66b722ecbbe720494bd94ae4f097257461b2800..2347fc4090ea2be7e93eed10cc08f98448fc4ae7 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ <groupId>org.openapitools</groupId> <artifactId>openapi-generator-project</artifactId> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <relativePath>../..</relativePath> </parent> diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index d4d9902da7f03e8375ecfadc65cb6c516c10fae0..0c182417c9437d954ff8c5ac6f18fe2c00717d19 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -42,15 +42,17 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { private Boolean hstsFeatureEnabled = true; private Boolean corsFeatureEnabled = false; private Boolean compressionFeatureEnabled = true; + private Boolean locationsFeatureEnabled = true; - // This is here to potentially warn the user when an option is not supoprted by the target framework. + // This is here to potentially warn the user when an option is not supported by the target framework. private Map<String, List<String>> optionsSupportedPerFramework = new ImmutableMap.Builder<String, List<String>>() .put(Constants.KTOR, Arrays.asList( Constants.AUTOMATIC_HEAD_REQUESTS, Constants.CONDITIONAL_HEADERS, Constants.HSTS, Constants.CORS, - Constants.COMPRESSION + Constants.COMPRESSION, + Constants.LOCATIONS )) .build(); @@ -85,6 +87,8 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { artifactId = "kotlin-server"; packageName = "org.openapitools.server"; + typeMapping.put("array", "kotlin.collections.List"); + // cliOptions default redefinition need to be updated updateOption(CodegenConstants.ARTIFACT_ID, this.artifactId); updateOption(CodegenConstants.PACKAGE_NAME, this.packageName); @@ -110,6 +114,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { addSwitch(Constants.HSTS, Constants.HSTS_DESC, getHstsFeatureEnabled()); addSwitch(Constants.CORS, Constants.CORS_DESC, getCorsFeatureEnabled()); addSwitch(Constants.COMPRESSION, Constants.COMPRESSION_DESC, getCompressionFeatureEnabled()); + addSwitch(Constants.LOCATIONS, Constants.LOCATIONS_DESC, getLocationsFeatureEnabled()); } public Boolean getAutoHeadFeatureEnabled() { @@ -156,6 +161,14 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { this.hstsFeatureEnabled = hstsFeatureEnabled; } + public Boolean getLocationsFeatureEnabled() { + return locationsFeatureEnabled; + } + + public void setLocationsFeatureEnabled(Boolean locationsFeatureEnabled) { + this.locationsFeatureEnabled = locationsFeatureEnabled; + } + public String getName() { return "kotlin-server"; } @@ -209,6 +222,12 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { additionalProperties.put(Constants.COMPRESSION, getCompressionFeatureEnabled()); } + if (additionalProperties.containsKey(Constants.LOCATIONS)) { + setLocationsFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.LOCATIONS)); + } else { + additionalProperties.put(Constants.LOCATIONS, getLocationsFeatureEnabled()); + } + boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS); String packageFolder = (sourceFolder + File.separator + packageName).replace(".", File.separator); String resourcesFolder = "src/main/resources"; // not sure this can be user configurable. @@ -223,7 +242,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { supportingFiles.add(new SupportingFile("AppMain.kt.mustache", packageFolder, "AppMain.kt")); supportingFiles.add(new SupportingFile("Configuration.kt.mustache", packageFolder, "Configuration.kt")); - if (generateApis) { + if (generateApis && locationsFeatureEnabled) { supportingFiles.add(new SupportingFile("Paths.kt.mustache", packageFolder, "Paths.kt")); } @@ -247,6 +266,8 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { public final static String CORS_DESC = "Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org."; public final static String COMPRESSION = "featureCompression"; public final static String COMPRESSION_DESC = "Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response."; + public final static String LOCATIONS = "featureLocations"; + public final static String LOCATIONS_DESC = "Generates routes in a typed way, for both: constructing URLs and reading the parameters."; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java new file mode 100644 index 0000000000000000000000000000000000000000..84cee1d2aa97832520ba4bd17eed6a817c6a3fb6 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java @@ -0,0 +1,270 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import com.google.common.collect.ImmutableMap; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +public class KotlinServerDeprecatedCodegen extends AbstractKotlinCodegen { + + public static final String DEFAULT_LIBRARY = Constants.KTOR; + private final Logger LOGGER = LoggerFactory.getLogger(KotlinServerDeprecatedCodegen.class); + private Boolean autoHeadFeatureEnabled = true; + private Boolean conditionalHeadersFeatureEnabled = false; + private Boolean hstsFeatureEnabled = true; + private Boolean corsFeatureEnabled = false; + private Boolean compressionFeatureEnabled = true; + + // This is here to potentially warn the user when an option is not supported by the target framework. + private Map<String, List<String>> optionsSupportedPerFramework = new ImmutableMap.Builder<String, List<String>>() + .put(Constants.KTOR, Arrays.asList( + Constants.AUTOMATIC_HEAD_REQUESTS, + Constants.CONDITIONAL_HEADERS, + Constants.HSTS, + Constants.CORS, + Constants.COMPRESSION + )) + .build(); + + /** + * Constructs an instance of `KotlinServerDeprecatedCodegen`. + */ + public KotlinServerDeprecatedCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) + .securityFeatures(EnumSet.of( + SecurityFeature.BasicAuth, + SecurityFeature.ApiKey, + SecurityFeature.OAuth2_Implicit + )) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .excludeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism + ) + .excludeParameterFeatures( + ParameterFeature.Cookie + ) + ); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.DEPRECATED) + .build(); + + artifactId = "kotlin-server-deprecated"; + packageName = "org.openapitools.server"; + + // cliOptions default redefinition need to be updated + updateOption(CodegenConstants.ARTIFACT_ID, this.artifactId); + updateOption(CodegenConstants.PACKAGE_NAME, this.packageName); + + outputFolder = "generated-code" + File.separator + "kotlin-server-deprecated"; + modelTemplateFiles.put("model.mustache", ".kt"); + apiTemplateFiles.put("api.mustache", ".kt"); + embeddedTemplateDir = templateDir = "kotlin-server-deprecated"; + apiPackage = packageName + ".apis"; + modelPackage = packageName + ".models"; + + supportedLibraries.put(Constants.KTOR, "ktor framework"); + + // TODO: Configurable server engine. Defaults to netty in build.gradle. + CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC); + library.setDefault(DEFAULT_LIBRARY); + library.setEnum(supportedLibraries); + + cliOptions.add(library); + + addSwitch(Constants.AUTOMATIC_HEAD_REQUESTS, Constants.AUTOMATIC_HEAD_REQUESTS_DESC, getAutoHeadFeatureEnabled()); + addSwitch(Constants.CONDITIONAL_HEADERS, Constants.CONDITIONAL_HEADERS_DESC, getConditionalHeadersFeatureEnabled()); + addSwitch(Constants.HSTS, Constants.HSTS_DESC, getHstsFeatureEnabled()); + addSwitch(Constants.CORS, Constants.CORS_DESC, getCorsFeatureEnabled()); + addSwitch(Constants.COMPRESSION, Constants.COMPRESSION_DESC, getCompressionFeatureEnabled()); + } + + public Boolean getAutoHeadFeatureEnabled() { + return autoHeadFeatureEnabled; + } + + public void setAutoHeadFeatureEnabled(Boolean autoHeadFeatureEnabled) { + this.autoHeadFeatureEnabled = autoHeadFeatureEnabled; + } + + public Boolean getCompressionFeatureEnabled() { + return compressionFeatureEnabled; + } + + public void setCompressionFeatureEnabled(Boolean compressionFeatureEnabled) { + this.compressionFeatureEnabled = compressionFeatureEnabled; + } + + public Boolean getConditionalHeadersFeatureEnabled() { + return conditionalHeadersFeatureEnabled; + } + + public void setConditionalHeadersFeatureEnabled(Boolean conditionalHeadersFeatureEnabled) { + this.conditionalHeadersFeatureEnabled = conditionalHeadersFeatureEnabled; + } + + public Boolean getCorsFeatureEnabled() { + return corsFeatureEnabled; + } + + public void setCorsFeatureEnabled(Boolean corsFeatureEnabled) { + this.corsFeatureEnabled = corsFeatureEnabled; + } + + public String getHelp() { + return "Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated." + + " Please migrate to `kotlin-server` which supports Ktor v1.5.2+."; + } + + public Boolean getHstsFeatureEnabled() { + return hstsFeatureEnabled; + } + + public void setHstsFeatureEnabled(Boolean hstsFeatureEnabled) { + this.hstsFeatureEnabled = hstsFeatureEnabled; + } + + public String getName() { + return "kotlin-server-deprecated"; + } + + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); + } + + // set default library to "ktor" + if (StringUtils.isEmpty(library)) { + this.setLibrary(DEFAULT_LIBRARY); + additionalProperties.put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY); + LOGGER.info("`library` option is empty. Default to " + DEFAULT_LIBRARY); + } + + if (additionalProperties.containsKey(Constants.AUTOMATIC_HEAD_REQUESTS)) { + setAutoHeadFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.AUTOMATIC_HEAD_REQUESTS)); + } else { + additionalProperties.put(Constants.AUTOMATIC_HEAD_REQUESTS, getAutoHeadFeatureEnabled()); + } + + if (additionalProperties.containsKey(Constants.CONDITIONAL_HEADERS)) { + setConditionalHeadersFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.CONDITIONAL_HEADERS)); + } else { + additionalProperties.put(Constants.CONDITIONAL_HEADERS, getConditionalHeadersFeatureEnabled()); + } + + if (additionalProperties.containsKey(Constants.HSTS)) { + setHstsFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.HSTS)); + } else { + additionalProperties.put(Constants.HSTS, getHstsFeatureEnabled()); + } + + if (additionalProperties.containsKey(Constants.CORS)) { + setCorsFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.CORS)); + } else { + additionalProperties.put(Constants.CORS, getCorsFeatureEnabled()); + } + + if (additionalProperties.containsKey(Constants.COMPRESSION)) { + setCompressionFeatureEnabled(convertPropertyToBooleanAndWriteBack(Constants.COMPRESSION)); + } else { + additionalProperties.put(Constants.COMPRESSION, getCompressionFeatureEnabled()); + } + + boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS); + String packageFolder = (sourceFolder + File.separator + packageName).replace(".", File.separator); + String resourcesFolder = "src/main/resources"; // not sure this can be user configurable. + + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); + + supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); + supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + supportingFiles.add(new SupportingFile("gradle.properties", "", "gradle.properties")); + + supportingFiles.add(new SupportingFile("AppMain.kt.mustache", packageFolder, "AppMain.kt")); + supportingFiles.add(new SupportingFile("Configuration.kt.mustache", packageFolder, "Configuration.kt")); + + if (generateApis) { + supportingFiles.add(new SupportingFile("Paths.kt.mustache", packageFolder, "Paths.kt")); + } + + supportingFiles.add(new SupportingFile("application.conf.mustache", resourcesFolder, "application.conf")); + supportingFiles.add(new SupportingFile("logback.xml", resourcesFolder, "logback.xml")); + + final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", File.separator); + + supportingFiles.add(new SupportingFile("ApiKeyAuth.kt.mustache", infrastructureFolder, "ApiKeyAuth.kt")); + } + + public static class Constants { + public final static String KTOR = "ktor"; + public final static String AUTOMATIC_HEAD_REQUESTS = "featureAutoHead"; + public final static String AUTOMATIC_HEAD_REQUESTS_DESC = "Automatically provide responses to HEAD requests for existing routes that have the GET verb defined."; + public final static String CONDITIONAL_HEADERS = "featureConditionalHeaders"; + public final static String CONDITIONAL_HEADERS_DESC = "Avoid sending content if client already has same content, by checking ETag or LastModified properties."; + public final static String HSTS = "featureHSTS"; + public final static String HSTS_DESC = "Avoid sending content if client already has same content, by checking ETag or LastModified properties."; + public final static String CORS = "featureCORS"; + public final static String CORS_DESC = "Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org."; + public final static String COMPRESSION = "featureCompression"; + public final static String COMPRESSION_DESC = "Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response."; + } + + @Override + public void postProcess() { + System.out.println("################################################################################"); + System.out.println("# Thanks for using OpenAPI Generator. #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# https://opencollective.com/openapi_generator/donate #"); + System.out.println("# #"); + System.out.println("# This generator's contributed by Jim Schubert (https://github.com/jimschubert)#"); + System.out.println("# Please support his work directly via https://patreon.com/jimschubert \uD83D\uDE4F #"); + System.out.println("################################################################################"); + } +} 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 87811995525d57a870d1e8297b742cf7be7aeb7c..a00683cbd4a008a82b589225a25b0b0d64770adf 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 @@ -67,10 +67,6 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { // in other code generators, support needs to be enabled on a case-by-case basis. supportsAdditionalPropertiesWithComposedSchema = true; - // When the 'additionalProperties' keyword is not present in a OAS schema, allow - // undeclared properties. This is compliant with the JSON schema specification. - this.setDisallowAdditionalPropertiesIfNotPresent(false); - modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) @@ -96,9 +92,8 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { ParameterFeature.Cookie ) ); - - // this may set datatype right for additional properties - instantiationTypes.put("map", "dict"); + // needed for type object with additionalProperties: false + typeMapping.put("object", "dict"); languageSpecificPrimitives.add("file_type"); languageSpecificPrimitives.add("none_type"); @@ -113,6 +108,20 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC) .defaultValue(Boolean.FALSE.toString())); + // option to change how we process + set the data in the 'additionalProperties' keyword. + CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString()); + Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); + disallowAdditionalPropertiesIfNotPresentOpts.put("false", + "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); + disallowAdditionalPropertiesIfNotPresentOpts.put("true", + "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: "+ + "this option breaks composition and will be removed in 6.0.0" + ); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.EXPERIMENTAL) .build(); @@ -162,6 +171,18 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { } additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); + // When the 'additionalProperties' keyword is not present in a OAS schema, allow + // undeclared properties. This is compliant with the JSON schema specification. + // setting this to false is required to have composed schemas work because: + // anyOf SchemaA + SchemaB, requires that props present only in A are accepted in B because in B + // they are additional properties + Boolean disallowAddProps = false; + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + disallowAddProps = Boolean.valueOf(additionalProperties.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()); + } + this.setDisallowAdditionalPropertiesIfNotPresent(disallowAddProps); + + // check library option to ensure only urllib3 is supported if (!DEFAULT_LIBRARY.equals(getLibrary())) { throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); @@ -730,6 +751,62 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { return null; } + @Override + protected Schema getAdditionalProperties(Schema schema) { + /* + Use cases: + 1. addProps set to schema in spec: return that schema + 2. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent -> null + 3. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent=False -> new Schema() + 4. addProps true -> new Schema() NOTE: v3 only + 5. addprops false -> null NOTE: v3 only + */ + Object addProps = schema.getAdditionalProperties(); + if (addProps instanceof Schema) { + return (Schema) addProps; + } + if (addProps == null) { + // When reaching this code path, this should indicate the 'additionalProperties' keyword is + // not present in the OAS schema. This is true for OAS 3.0 documents. + // However, the parsing logic is broken for OAS 2.0 documents because of the + // https://github.com/swagger-api/swagger-parser/issues/1369 issue. + // When OAS 2.0 documents are parsed, the swagger-v2-converter ignores the 'additionalProperties' + // keyword if the value is boolean. That means codegen is unable to determine whether + // additional properties are allowed or not. + // + // The original behavior was to assume additionalProperties had been set to false. + if (getDisallowAdditionalPropertiesIfNotPresent()) { + // If the 'additionalProperties' keyword is not present in a OAS schema, + // interpret as if the 'additionalProperties' keyword had been set to false. + // This is NOT compliant with the JSON schema specification. It is the original + // 'openapi-generator' behavior. + return null; + } + /* + // The disallowAdditionalPropertiesIfNotPresent CLI option has been set to true, + // but for now that only works with OAS 3.0 documents. + // The new behavior does not work with OAS 2.0 documents. + if (extensions == null || !extensions.containsKey(EXTENSION_OPENAPI_DOC_VERSION)) { + // Fallback to the legacy behavior. + return null; + } + // Get original swagger version from OAS extension. + // Note openAPI.getOpenapi() is always set to 3.x even when the document + // is converted from a OAS/Swagger 2.0 document. + // https://github.com/swagger-api/swagger-parser/pull/1374 + SemVer version = new SemVer((String)extensions.get(EXTENSION_OPENAPI_DOC_VERSION)); + if (version.major != 3) { + return null; + } + */ + } + if (addProps == null || (addProps instanceof Boolean && (Boolean) addProps)) { + // Return empty schema to allow any type + return new Schema(); + } + return null; + } + /** * Return a string representation of the Python types for the specified OAS schema. * Primitive types in the OAS specification are implemented in Python using the corresponding @@ -769,16 +846,39 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { } } if (isAnyTypeSchema(p)) { + // for v2 specs only, swagger-parser never generates an AnyType schemas even though it should generate them + // https://github.com/swagger-api/swagger-parser/issues/1378 + // switch to v3 if you need AnyType to work return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; } + String originalSpecVersion = "X"; + if (this.openAPI.getExtensions() != null && this.openAPI.getExtensions().containsKey("x-original-swagger-version")) { + originalSpecVersion = (String) this.openAPI.getExtensions().get("x-original-swagger-version"); + originalSpecVersion = originalSpecVersion.substring(0, 1); + + } + Boolean v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase = (getAdditionalProperties(p) == null && this.getDisallowAdditionalPropertiesIfNotPresent() && originalSpecVersion.equals("2")); + Schema emptySchema = new Schema(); + Boolean v2WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("2")); + if (isFreeFormObject(p) && (v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase || v2WithCompositionAddPropsAnyTypeSchemaCase)) { + // for v2 specs only, input AnyType schemas (type unset) or schema {} results in FreeFromObject schemas + // per https://github.com/swagger-api/swagger-parser/issues/1378 + // v2 spec uses cases + // 1. AnyType schemas + // 2. type object schema with no other info + // use case 1 + 2 -> both become use case 1 + // switch to v3 if you need use cases 1 + 2 to work correctly + return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + fullSuffix; + } // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { fullSuffix = ", none_type" + suffix; } - if (isFreeFormObject(p) && getAdditionalProperties(p) == null) { - return prefix + "bool, date, datetime, dict, float, int, list, str" + fullSuffix; - } - if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { + Boolean v3WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("3")); + if (isFreeFormObject(p) && v3WithCompositionAddPropsAnyTypeSchemaCase) { + // v3 code path, use case: type object schema with no other schema info + return prefix + "{str: (bool, date, datetime, dict, float, int, list, str, none_type)}" + fullSuffix; + } else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { Schema inner = getAdditionalProperties(p); return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; } else if (ModelUtils.isArraySchema(p)) { @@ -837,7 +937,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { // The 'addProps' may be a reference, getTypeDeclaration will resolve // the reference. List<String> referencedModelNames = new ArrayList<String>(); - codegenModel.additionalPropertiesType = getTypeString(addProps, "", "", referencedModelNames); + getTypeString(addProps, "", "", referencedModelNames); if (referencedModelNames.size() != 0) { // Models that are referenced in the 'additionalPropertiesType' keyword // must be added to the imports. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index 8a213a37757a87ac115c82d381785b585a32ed1a..138b1c543566300355ef1a56cb88f6da506f8931 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -36,6 +36,7 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements // nose is a python testing framework, we use pytest if USE_NOSE is unset public static final String USE_NOSE = "useNose"; public static final String RECURSION_LIMIT = "recursionLimit"; + public static final String PYTHON_ATTR_NONE_IF_UNSET = "pythonAttrNoneIfUnset"; protected String packageUrl; protected String apiDocPath = "docs/"; diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 87ab2b5e352c999755d812069ff3e048e1d7e343..4226cade162ad81ef64090771f3f7bf7a052ddb8 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -44,6 +44,7 @@ org.openapitools.codegen.languages.GraphQLNodeJSExpressServerCodegen org.openapitools.codegen.languages.GroovyClientCodegen org.openapitools.codegen.languages.KotlinClientCodegen org.openapitools.codegen.languages.KotlinServerCodegen +org.openapitools.codegen.languages.KotlinServerDeprecatedCodegen org.openapitools.codegen.languages.KotlinSpringServerCodegen org.openapitools.codegen.languages.KotlinVertxServerCodegen org.openapitools.codegen.languages.KtormSchemaCodegen diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache new file mode 100644 index 0000000000000000000000000000000000000000..24c4728fdd3aa4f0861f3417ad4616eba4db4cfb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache @@ -0,0 +1,84 @@ +# {{packageName}} - Kotlin Server library for {{appName}} + +## Requires + +* Kotlin 1.1.2 +* Gradle 3.3 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. + +{{#generateApiDocs}} +<a name="documentation-for-api-endpoints"></a> +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} +<a name="documentation-for-models"></a> +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} +{{/generateModelDocs}} + +<a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }} +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} +<a name="{{name}}"></a> +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/api_doc.mustache new file mode 100644 index 0000000000000000000000000000000000000000..08d90eef4a2b2b4bd08b72633d21710b315e3372 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/api_doc.mustache @@ -0,0 +1,65 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +<a name="{{operationId}}"></a> +# **{{operationId}}** +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +### Example +```kotlin +// Import classes: +//import {{{packageName}}}.infrastructure.* +//import {{{modelPackage}}}.* + +{{! TODO: Auth method documentation examples}} +val apiInstance = {{{classname}}}() +{{#allParams}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +{{/allParams}} +try { + {{#returnType}}val result : {{{returnType}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} + println(result){{/returnType}} +} catch (e: ClientException) { + println("4xx response calling {{{classname}}}#{{{operationId}}}") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling {{{classname}}}#{{{operationId}}}") + e.printStackTrace() +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/class_doc.mustache new file mode 100644 index 0000000000000000000000000000000000000000..a3405b25c845a03d357f9473cddc9fa07f7f0db0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/class_doc.mustache @@ -0,0 +1,15 @@ +# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{/vars}} +{{#vars}}{{#isEnum}} + +<a name="{{{datatypeWithEnum}}}"></a>{{!NOTE: see java's resources "pojo_doc.mustache" once enums are fully implemented}} +## Enum: {{baseName}} +Name | Value +---- | -----{{#allowableValues}} +{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +{{/isEnum}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache new file mode 100644 index 0000000000000000000000000000000000000000..e22559b5cc986341b4b5142f0c848a6fb7b2602a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache @@ -0,0 +1,52 @@ +{{#parcelizeModels}} +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +{{/parcelizeModels}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} +/** + * {{{description}}} +{{#vars}} + * @param {{name}} {{{description}}} +{{/vars}} + */ +{{#parcelizeModels}} +@Parcelize +{{/parcelizeModels}} +data class {{classname}} ( +{{#requiredVars}} +{{>data_class_req_var}}{{^-last}}, +{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, +{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, +{{/-last}}{{/optionalVars}} +) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}}{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} +{{#vendorExtensions.x-has-data-class-body}} +{ +{{/vendorExtensions.x-has-data-class-body}} +{{#serializableModel}} + companion object { + private const val serialVersionUID: Long = 123 + } +{{/serializableModel}} +{{#hasEnums}} + {{#vars}} + {{#isEnum}} + /** + * {{{description}}} + * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + */ + enum class {{nameInCamelCase}}(val value: {{dataType}}){ + {{#allowableValues}} + {{#enumVars}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + } +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +{{#vendorExtensions.x-has-data-class-body}} +} +{{/vendorExtensions.x-has-data-class-body}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache new file mode 100644 index 0000000000000000000000000000000000000000..b1060118732055cf5b2a231c4de40130ac14595b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache @@ -0,0 +1,4 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache new file mode 100644 index 0000000000000000000000000000000000000000..c79bfec01bd0eb7439ddf9f884d4f9f12b93fd81 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache @@ -0,0 +1,4 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_class.mustache new file mode 100644 index 0000000000000000000000000000000000000000..791398b97894d171d705e79048d75d6dc652f2bc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_class.mustache @@ -0,0 +1,9 @@ +/** +* {{{description}}} +* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} +*/ +enum class {{classname}}(val value: {{dataType}}){ +{{#allowableValues}}{{#enumVars}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} +{{/enumVars}}{{/allowableValues}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_doc.mustache new file mode 100644 index 0000000000000000000000000000000000000000..fcb3d7e61aa6ef1d7e1cd90b1d6eb3b265216f41 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/enum_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} + * `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/ApiKeyAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/ApiKeyAuth.kt.mustache new file mode 100644 index 0000000000000000000000000000000000000000..e50c0793be45867900e32866b4c6680d24d7fc4d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/ApiKeyAuth.kt.mustache @@ -0,0 +1,85 @@ +package {{packageName}}.infrastructure + +import io.ktor.application.ApplicationCall +import io.ktor.application.call +import io.ktor.auth.Authentication +import io.ktor.auth.AuthenticationFailedCause +import io.ktor.auth.AuthenticationPipeline +import io.ktor.auth.AuthenticationProvider +import io.ktor.auth.Credential +import io.ktor.auth.Principal +import io.ktor.auth.UnauthorizedResponse +import io.ktor.http.auth.HeaderValueEncoding +import io.ktor.http.auth.HttpAuthHeader +import io.ktor.request.ApplicationRequest +import io.ktor.response.respond + +enum class ApiKeyLocation(val location: String) { + QUERY("query"), + HEADER("header") +} +data class ApiKeyCredential(val value: String): Credential +data class ApiPrincipal(val apiKeyCredential: ApiKeyCredential?) : Principal + + + +/** +* Represents a Api Key authentication provider +* @param name is the name of the provider, or `null` for a default provider +*/ +class ApiKeyAuthenticationProvider(name: String?) : AuthenticationProvider(name) { + internal var authenticationFunction: suspend ApplicationCall.(ApiKeyCredential) -> Principal? = { null } + + var apiKeyName: String = ""; + + var apiKeyLocation: ApiKeyLocation = ApiKeyLocation.QUERY; + + /** + * Sets a validation function that will check given [ApiKeyCredential] instance and return [Principal], + * or null if credential does not correspond to an authenticated principal + */ + fun validate(body: suspend ApplicationCall.(ApiKeyCredential) -> Principal?) { + authenticationFunction = body + } +} + +fun Authentication.Configuration.apiKeyAuth(name: String? = null, configure: ApiKeyAuthenticationProvider.() -> Unit) { + val provider = ApiKeyAuthenticationProvider(name).apply(configure) + val apiKeyName = provider.apiKeyName + val apiKeyLocation = provider.apiKeyLocation + val authenticate = provider.authenticationFunction + + provider.pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> + val credentials = call.request.apiKeyAuthenticationCredentials(apiKeyName, apiKeyLocation) + val principal = credentials?.let { authenticate(call, it) } + + val cause = when { + credentials == null -> AuthenticationFailedCause.NoCredentials + principal == null -> AuthenticationFailedCause.InvalidCredentials + else -> null + } + + if (cause != null) { + context.challenge(apiKeyName, cause) { + // TODO: Verify correct response structure here. + call.respond(UnauthorizedResponse(HttpAuthHeader.Parameterized("API_KEY", mapOf("key" to apiKeyName), HeaderValueEncoding.QUOTED_ALWAYS))) + it.complete() + } + } + + if (principal != null) { + context.principal(principal) + } + } +} + +fun ApplicationRequest.apiKeyAuthenticationCredentials(apiKeyName: String, apiKeyLocation: ApiKeyLocation): ApiKeyCredential? { + val value: String? = when(apiKeyLocation) { + ApiKeyLocation.QUERY -> this.queryParameters[apiKeyName] + ApiKeyLocation.HEADER -> this.headers[apiKeyName] + } + when (value) { + null -> return null + else -> return ApiKeyCredential(value) + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache new file mode 100644 index 0000000000000000000000000000000000000000..bef736de059bb6ad72773543d01aad8b625867b1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache @@ -0,0 +1,145 @@ +package {{packageName}} + +import com.codahale.metrics.Slf4jReporter +import com.typesafe.config.ConfigFactory +import io.ktor.application.Application +import io.ktor.application.ApplicationStopping +import io.ktor.application.install +import io.ktor.application.log +import io.ktor.client.HttpClient +import io.ktor.client.engine.apache.Apache +import io.ktor.config.HoconApplicationConfig +{{#featureAutoHead}} +import io.ktor.features.AutoHeadResponse +{{/featureAutoHead}} +{{#featureCompression}} +import io.ktor.features.Compression +{{/featureCompression}} +{{#featureCORS}} +import io.ktor.features.CORS +{{/featureCORS}} +{{#featureConditionalHeaders}} +import io.ktor.features.ConditionalHeaders +{{/featureConditionalHeaders}} +import io.ktor.features.ContentNegotiation +import io.ktor.features.DefaultHeaders +{{#featureHSTS}} +import io.ktor.features.HSTS +{{/featureHSTS}} +import io.ktor.gson.GsonConverter +import io.ktor.http.ContentType +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.Locations +import io.ktor.metrics.Metrics +import io.ktor.routing.Routing +import java.util.concurrent.TimeUnit +import io.ktor.util.KtorExperimentalAPI +{{#hasAuthMethods}} +import io.ktor.auth.Authentication +import io.ktor.auth.oauth +import org.openapitools.server.infrastructure.ApiKeyCredential +import org.openapitools.server.infrastructure.ApiPrincipal +import org.openapitools.server.infrastructure.apiKeyAuth +{{/hasAuthMethods}} +{{#generateApis}}{{#apiInfo}}{{#apis}}import {{apiPackage}}.{{classname}} +{{/apis}}{{/apiInfo}}{{/generateApis}} + +@KtorExperimentalAPI +internal val settings = HoconApplicationConfig(ConfigFactory.defaultApplication(HTTP::class.java.classLoader)) + +object HTTP { + val client = HttpClient(Apache) +} + +@KtorExperimentalAPI +@KtorExperimentalLocationsAPI +fun Application.main() { + install(DefaultHeaders) + install(Metrics) { + val reporter = Slf4jReporter.forRegistry(registry) + .outputTo(log) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build() + reporter.start(10, TimeUnit.SECONDS) + } +{{#generateApis}} + install(ContentNegotiation) { + register(ContentType.Application.Json, GsonConverter()) + } + {{#featureAutoHead}} + install(AutoHeadResponse) // see http://ktor.io/features/autoheadresponse.html + {{/featureAutoHead}} + {{#featureConditionalHeaders}} + install(ConditionalHeaders) // see http://ktor.io/features/conditional-headers.html + {{/featureConditionalHeaders}} + {{#featureHSTS}} + install(HSTS, ApplicationHstsConfiguration()) // see http://ktor.io/features/hsts.html + {{/featureHSTS}} + {{#featureCORS}} + install(CORS, ApplicationCORSConfiguration()) // see http://ktor.io/features/cors.html + {{/featureCORS}} + {{#featureCompression}} + install(Compression, ApplicationCompressionConfiguration()) // see http://ktor.io/features/compression.html + {{/featureCompression}} + install(Locations) // see http://ktor.io/features/locations.html + {{#hasAuthMethods}} + install(Authentication) { + {{#authMethods}} + {{#isBasic}} + basic("{{{name}}}") { + validate { credentials -> + // TODO: "Apply your basic authentication functionality." + // Accessible in-method via call.principal<UserIdPrincipal>() + if (credentials.name == "Swagger" && "Codegen" == credentials.password) { + UserIdPrincipal(credentials.name) + } else { + null + } + } + {{/isBasic}} + {{#isApiKey}} + // "Implement API key auth ({{{name}}}) for parameter name '{{{keyParamName}}}'." + apiKeyAuth("{{{name}}}") { + validate { apikeyCredential: ApiKeyCredential -> + when { + apikeyCredential.value == "keyboardcat" -> ApiPrincipal(apikeyCredential) + else -> null + } + } + } + {{/isApiKey}} + {{#isOAuth}} + {{#bodyAllowed}} + {{/bodyAllowed}} + {{^bodyAllowed}} + oauth("{{name}}") { + client = HttpClient(Apache) + providerLookup = { ApplicationAuthProviders["{{{name}}}"] } + urlProvider = { _ -> + // TODO: define a callback url here. + "/" + } + } + {{/bodyAllowed}} + {{/isOAuth}} + {{/authMethods}} + } + {{/hasAuthMethods}} + install(Routing) { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{classname}}() + {{/operations}} + {{/apis}} + {{/apiInfo}} + } + +{{/generateApis}} + + environment.monitor.subscribe(ApplicationStopping) + { + HTTP.client.close() + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Configuration.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Configuration.kt.mustache new file mode 100644 index 0000000000000000000000000000000000000000..3b568d21eba9f06f783f2ac1fb866ed8e57ae7e7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Configuration.kt.mustache @@ -0,0 +1,114 @@ +package {{packageName}} + +// Use this file to hold package-level internal functions that return receiver object passed to the `install` method. +import io.ktor.auth.OAuthServerSettings +import io.ktor.features.Compression +import io.ktor.features.HSTS +import io.ktor.features.deflate +import io.ktor.features.gzip +import io.ktor.features.minimumSize +import io.ktor.http.HttpMethod +import io.ktor.util.KtorExperimentalAPI +import java.time.Duration +import java.util.concurrent.Executors + +import {{packageName}}.settings + +{{#featureCORS}} +/** + * Application block for [CORS] configuration. + * + * This file may be excluded in .openapi-generator-ignore, + * and application specific configuration can be applied in this function. + * + * See http://ktor.io/features/cors.html + */ +internal fun ApplicationCORSConfiguration(): CORS.Configuration.() -> Unit { + return { + // method(HttpMethod.Options) + // header(HttpHeaders.XForwardedProto) + // anyHost() + // host("my-host") + // host("my-host:80") + // host("my-host", subDomains = listOf("www")) + // host("my-host", schemes = listOf("http", "https")) + // allowCredentials = true + // maxAge = Duration.ofDays(1) + } +} +{{/featureCORS}} + +{{#featureHSTS}} +/** + * Application block for [HSTS] configuration. + * + * This file may be excluded in .openapi-generator-ignore, + * and application specific configuration can be applied in this function. + * + * See http://ktor.io/features/hsts.html + */ +internal fun ApplicationHstsConfiguration(): HSTS.Configuration.() -> Unit { + return { + maxAge = Duration.ofDays(365) + includeSubDomains = true + preload = false + + // You may also apply any custom directives supported by specific user-agent. For example: + // customDirectives.put("redirectHttpToHttps", "false") + } +} +{{/featureHSTS}} + +{{#featureCompression}} +/** + * Application block for [Compression] configuration. + * + * This file may be excluded in .openapi-generator-ignore, + * and application specific configuration can be applied in this function. + * + * See http://ktor.io/features/compression.html + */ +internal fun ApplicationCompressionConfiguration(): Compression.Configuration.() -> Unit { + return { + gzip { + priority = 1.0 + } + deflate { + priority = 10.0 + minimumSize(1024) // condition + } + } +} +{{/featureCompression}} + +// Defines authentication mechanisms used throughout the application. +@KtorExperimentalAPI +val ApplicationAuthProviders: Map<String, OAuthServerSettings> = listOf<OAuthServerSettings>( +{{#authMethods}} + {{#isOAuth}} + OAuthServerSettings.OAuth2ServerSettings( + name = "{{name}}", + authorizeUrl = "{{authorizationUrl}}", + accessTokenUrl = "{{tokenUrl}}", + requestMethod = HttpMethod.Get, + {{! TODO: flow, doesn't seem to be supported yet by ktor }} + clientId = settings.property("auth.oauth.{{name}}.clientId").getString(), + clientSecret = settings.property("auth.oauth.{{name}}.clientSecret").getString(), + defaultScopes = listOf({{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}}) + ){{^-last}},{{/-last}} + {{/isOAuth}} +{{/authMethods}} +// OAuthServerSettings.OAuth2ServerSettings( +// name = "facebook", +// authorizeUrl = "https://graph.facebook.com/oauth/authorize", +// accessTokenUrl = "https://graph.facebook.com/oauth/access_token", +// requestMethod = HttpMethod.Post, +// +// clientId = "settings.property("auth.oauth.facebook.clientId").getString()", +// clientSecret = "settings.property("auth.oauth.facebook.clientSecret").getString()", +// defaultScopes = listOf("public_profile") +// ) +).associateBy { it.name } + +// Provides an application-level fixed thread pool on which to execute coroutines (mainly) +internal val ApplicationExecutors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4) diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Dockerfile.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Dockerfile.mustache new file mode 100644 index 0000000000000000000000000000000000000000..b9158ac26e39d5e77eb8b9c8ad7083528a64adc0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Dockerfile.mustache @@ -0,0 +1,7 @@ +FROM openjdk:8-jre-alpine + +COPY ./build/libs/{{artifactId}}.jar /root/{{artifactId}}.jar + +WORKDIR /root + +CMD ["java", "-server", "-Xms4g", "-Xmx4g", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "{{artifactId}}.jar"] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Paths.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Paths.kt.mustache new file mode 100644 index 0000000000000000000000000000000000000000..610f48203aa07349f340f7c57f973310cd880182 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/Paths.kt.mustache @@ -0,0 +1,28 @@ +{{>licenseInfo}} +package {{packageName}} + +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.Location +{{#imports}}import {{import}} +{{/imports}} + +{{#apiInfo}} +object Paths { +{{#apis}} +{{#operations}} + {{#operation}} + {{^bodyAllowed}} + /** + * {{summary}} + * {{#unescapedNotes}}{{.}}{{/unescapedNotes}} + {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}}*/ + @KtorExperimentalLocationsAPI + @Location("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{^required}}? = null{{/required}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + + {{/bodyAllowed}} + {{/operation}} +{{/operations}} +{{/apis}} +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache new file mode 100644 index 0000000000000000000000000000000000000000..4c34e8f6bf2d49eab04fea1d59ef19e1a2fa8e65 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache @@ -0,0 +1,101 @@ +# {{packageName}} - Kotlin Server library for {{appName}} + +{{#unescapedAppDescription}} +{{.}} +{{/unescapedAppDescription}} + +Generated by OpenAPI Generator {{generatorVersion}}{{^hideGenerationTimestamp}} ({{generatedDate}}){{/hideGenerationTimestamp}}. + +## Requires + +* Kotlin 1.3.21 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Running + +The server builds as a fat jar with a main entrypoint. To start the service, run `java -jar ./build/libs/{{artifactId}}.jar`. + +You may also run in docker: + +``` +docker build -t {{artifactId}} . +docker run -p 8080:8080 {{artifactId}} +``` + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs (see ktor documentation for more info). +* ~Supports collection formats for query parameters: csv, tsv, ssv, pipes.~ +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. + +{{#generateApiDocs}} +<a name="documentation-for-api-endpoints"></a> +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} +<a name="documentation-for-models"></a> +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} +{{/generateModelDocs}} + +<a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }} +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} +<a name="{{name}}"></a> +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_api_body.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_api_body.mustache new file mode 100644 index 0000000000000000000000000000000000000000..9dcf500f49be78bbc93c2d44b4dfaa5345ef1f7c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_api_body.mustache @@ -0,0 +1,25 @@ +{{#hasAuthMethods}} +{{>libraries/ktor/_principal}} +if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) +} else { + {{#examples}} + {{#-first}} + {{#lambda.indented}}{{>_response}}{{/lambda.indented}} + {{/-first}} + {{/examples}} + {{^examples}} + call.respond(HttpStatusCode.NotImplemented) + {{/examples}} +} +{{/hasAuthMethods}} +{{^hasAuthMethods}} +{{#examples}} +{{#-first}} +{{>libraries/ktor/_response}} +{{/-first}} +{{/examples}} +{{^examples}} +call.respond(HttpStatusCode.NotImplemented) +{{/examples}} +{{/hasAuthMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache new file mode 100644 index 0000000000000000000000000000000000000000..d49c5d537f016c4d44a4d023aa9784e832656b36 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache @@ -0,0 +1,11 @@ +{{#authMethods}} +{{#isBasic}} +val principal = call.authentication.principal<UserIdPrincipal>() +{{/isBasic}} +{{#isApiKey}} +val principal = call.authentication.principal<ApiPrincipal>() +{{/isApiKey}} +{{#isOAuth}} +val principal = call.authentication.principal<OAuthAccessTokenResponse>() +{{/isOAuth}} +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_response.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_response.mustache new file mode 100644 index 0000000000000000000000000000000000000000..fb26fb4a7f1bbc9be4dbc7ffcf84da8b2b450e94 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_response.mustache @@ -0,0 +1,8 @@ +val exampleContentType = "{{{contentType}}}" +val exampleContentString = """{{&example}}""" + +when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/api.mustache new file mode 100644 index 0000000000000000000000000000000000000000..881e3b108ec3d85fda913ce320bdc61e2ea13943 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/api.mustache @@ -0,0 +1,62 @@ +{{>licenseInfo}} +package {{apiPackage}} + +import com.google.gson.Gson +import io.ktor.application.call +import io.ktor.auth.UserIdPrincipal +import io.ktor.auth.authentication +import io.ktor.auth.authenticate +import io.ktor.auth.OAuthAccessTokenResponse +import io.ktor.auth.OAuthServerSettings +import io.ktor.http.ContentType +import io.ktor.http.HttpStatusCode +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.response.respond +import io.ktor.response.respondText +import io.ktor.routing.Route +import io.ktor.routing.post +import io.ktor.routing.put +import io.ktor.routing.route + +import {{packageName}}.Paths +import {{packageName}}.infrastructure.ApiPrincipal + + +{{#imports}}import {{import}} +{{/imports}} + +{{#operations}} +@KtorExperimentalLocationsAPI +fun Route.{{classname}}() { + val gson = Gson() + val empty = mutableMapOf<String, Any?>() +{{#operation}} + {{#bodyAllowed}} + + route("{{path}}") { + {{#hasAuthMethods}} + {{#authMethods}} + authenticate("{{{name}}}") { + {{/authMethods}} + {{/hasAuthMethods}} + {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}} { + {{#lambda.indented_12}}{{>libraries/ktor/_api_body}}{{/lambda.indented_12}} + } + {{#hasAuthMethods}} + } + {{/hasAuthMethods}} + } + {{/bodyAllowed}} + {{^bodyAllowed}} + + {{! NOTE: Locations can be used on routes without body parameters.}} + {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}<Paths.{{operationId}}> { _: Paths.{{operationId}} -> + {{#lambda.indented_8}}{{>libraries/ktor/_api_body}}{{/lambda.indented_8}} + } + {{/bodyAllowed}} + +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/application.conf.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/application.conf.mustache new file mode 100644 index 0000000000000000000000000000000000000000..032be42fa11dbe8bb6c2da13c4dcc2eff0f09883 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/application.conf.mustache @@ -0,0 +1,27 @@ +ktor { + deployment { + environment = development + port = 8080 + autoreload = true + watch = [ {{packageName}} ] + } + + application { + modules = [ {{packageName}}.AppMainKt.main ] + } +} + +# Typesafe config allows multiple ways to provide configuration values without hard-coding them here. +# Please see https://github.com/lightbend/config for details. +auth { + oauth { +{{#authMethods}} +{{#isOAuth}} + {{name}} { + clientId = "" + clientSecret = "" + } +{{/isOAuth}} +{{/authMethods}} + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/build.gradle.mustache new file mode 100644 index 0000000000000000000000000000000000000000..08c317ea6669f8a098941a505535f11aeef6be13 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/build.gradle.mustache @@ -0,0 +1,68 @@ +group '{{groupId}}' +version '{{artifactVersion}}' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.21' + ext.ktor_version = '1.1.3' + ext.shadow_version = '2.0.3' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + maven { + url = "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version" + } +} + +apply plugin: 'java' +apply plugin: 'kotlin' +apply plugin: 'application' + +mainClassName = "io.ktor.server.netty.DevelopmentEngine" + +// Initialization order with shadow 2.0.1 and Gradle 4.3 is weird. +// See https://github.com/johnrengelman/shadow/issues/336#issuecomment-355402508 +apply plugin: 'com.github.johnrengelman.shadow' + +sourceCompatibility = 1.8 + +compileKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +compileTestKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +shadowJar { + baseName = '{{artifactId}}' + classifier = null + version = null +} + +repositories { + maven { url "https://repo1.maven.org/maven2" } + maven { url "https://dl.bintray.com/kotlin/ktor" } + maven { url "https://dl.bintray.com/kotlin/kotlinx" } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + compile "io.ktor:ktor-server-netty:$ktor_version" + compile "io.ktor:ktor-metrics:$ktor_version" + compile "io.ktor:ktor-locations:$ktor_version" + compile "io.ktor:ktor-gson:$ktor_version" + compile "io.ktor:ktor-client-core:$ktor_version" + compile "io.ktor:ktor-client-apache:$ktor_version" + compile "ch.qos.logback:logback-classic:1.2.1" + testCompile group: 'junit', name: 'junit', version: '4.13' +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/gradle.properties b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..5f1ed7bbe024aba4e43a0a42634da37ae4d0fe68 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/licenseInfo.mustache new file mode 100644 index 0000000000000000000000000000000000000000..3a547de74bb7a2be286e81242b14c95c0f560690 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** +* {{{appName}}} +* {{{appDescription}}} +* +* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} +* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/logback.xml b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..d0eaba8debd6ee390a715dcc280845b78b963ba4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/logback.xml @@ -0,0 +1,15 @@ +<configuration> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> + </encoder> + </appender> + + <root level="trace"> + <appender-ref ref="STDOUT"/> + </root> + + <logger name="org.eclipse.jetty" level="INFO"/> + <logger name="io.netty" level="INFO"/> + +</configuration> diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/licenseInfo.mustache new file mode 100644 index 0000000000000000000000000000000000000000..3a547de74bb7a2be286e81242b14c95c0f560690 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** +* {{{appName}}} +* {{{appDescription}}} +* +* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} +* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model.mustache new file mode 100644 index 0000000000000000000000000000000000000000..780dd84b97e03450af8ef6488946fb291000798c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model.mustache @@ -0,0 +1,11 @@ +{{>licenseInfo}} +package {{modelPackage}} + +{{#imports}}import {{import}} +{{/imports}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>enum_class}}{{/isEnum}}{{^isEnum}}{{>data_class}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/modelMutable.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/modelMutable.mustache new file mode 100644 index 0000000000000000000000000000000000000000..4c7f3900717199d48e502097a2d4206e5a99fa5f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/modelMutable.mustache @@ -0,0 +1 @@ +{{#modelMutable}}var{{/modelMutable}}{{^modelMutable}}val{{/modelMutable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model_doc.mustache new file mode 100644 index 0000000000000000000000000000000000000000..e3b7184211885b535ae220dfb4d8be28e65d5592 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/model_doc.mustache @@ -0,0 +1,3 @@ +{{#models}}{{#model}} +{{#isEnum}}{{>enum_doc}}{{/isEnum}}{{^isEnum}}{{>class_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/settings.gradle.mustache new file mode 100644 index 0000000000000000000000000000000000000000..448dc07602e2330993a4d97988edab06ea847706 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/settings.gradle.mustache @@ -0,0 +1 @@ +rootProject.name = '{{artifactId}}' \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache index 24c4728fdd3aa4f0861f3417ad4616eba4db4cfb..910f1a9c9e21bef40eed6c672bc5304ac160b959 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache @@ -2,8 +2,8 @@ ## Requires -* Kotlin 1.1.2 -* Gradle 3.3 +* Kotlin 1.4.31 +* Gradle 6.8.2 ## Build diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache index e22559b5cc986341b4b5142f0c848a6fb7b2602a..215a291253f11f5576fad2246b8fc7b52784bf6a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache @@ -15,7 +15,7 @@ import java.io.Serializable {{#parcelizeModels}} @Parcelize {{/parcelizeModels}} -data class {{classname}} ( +data class {{classname}}( {{#requiredVars}} {{>data_class_req_var}}{{^-last}}, {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache index 791398b97894d171d705e79048d75d6dc652f2bc..2f24a1de76b2e37138ad4dd46a818715e0983e0b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache @@ -2,7 +2,7 @@ * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ -enum class {{classname}}(val value: {{dataType}}){ +enum class {{classname}}(val value: {{dataType}}) { {{#allowableValues}}{{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/ApiKeyAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/ApiKeyAuth.kt.mustache index e50c0793be45867900e32866b4c6680d24d7fc4d..a0abbcddfd0475fdb2e75287ec735a7b4998d56d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/ApiKeyAuth.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/ApiKeyAuth.kt.mustache @@ -1,85 +1,105 @@ package {{packageName}}.infrastructure -import io.ktor.application.ApplicationCall -import io.ktor.application.call -import io.ktor.auth.Authentication -import io.ktor.auth.AuthenticationFailedCause -import io.ktor.auth.AuthenticationPipeline -import io.ktor.auth.AuthenticationProvider -import io.ktor.auth.Credential -import io.ktor.auth.Principal -import io.ktor.auth.UnauthorizedResponse -import io.ktor.http.auth.HeaderValueEncoding -import io.ktor.http.auth.HttpAuthHeader -import io.ktor.request.ApplicationRequest -import io.ktor.response.respond +import io.ktor.application.* +import io.ktor.auth.* +import io.ktor.http.auth.* +import io.ktor.request.* +import io.ktor.response.* enum class ApiKeyLocation(val location: String) { QUERY("query"), HEADER("header") } -data class ApiKeyCredential(val value: String): Credential -data class ApiPrincipal(val apiKeyCredential: ApiKeyCredential?) : Principal - +data class ApiKeyCredential(val value: String) : Credential +data class ApiPrincipal(val apiKeyCredential: ApiKeyCredential?) : Principal /** * Represents a Api Key authentication provider * @param name is the name of the provider, or `null` for a default provider */ -class ApiKeyAuthenticationProvider(name: String?) : AuthenticationProvider(name) { - internal var authenticationFunction: suspend ApplicationCall.(ApiKeyCredential) -> Principal? = { null } +class ApiKeyAuthenticationProvider(configuration: Configuration) : AuthenticationProvider(configuration) { - var apiKeyName: String = ""; + private val authenticationFunction = configuration.authenticationFunction - var apiKeyLocation: ApiKeyLocation = ApiKeyLocation.QUERY; + private val apiKeyName: String = configuration.apiKeyName - /** - * Sets a validation function that will check given [ApiKeyCredential] instance and return [Principal], - * or null if credential does not correspond to an authenticated principal - */ - fun validate(body: suspend ApplicationCall.(ApiKeyCredential) -> Principal?) { - authenticationFunction = body - } -} + private val apiKeyLocation: ApiKeyLocation = configuration.apiKeyLocation -fun Authentication.Configuration.apiKeyAuth(name: String? = null, configure: ApiKeyAuthenticationProvider.() -> Unit) { - val provider = ApiKeyAuthenticationProvider(name).apply(configure) - val apiKeyName = provider.apiKeyName - val apiKeyLocation = provider.apiKeyLocation - val authenticate = provider.authenticationFunction + internal fun install() { + pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> + val credentials = call.request.apiKeyAuthenticationCredentials(apiKeyName, apiKeyLocation) + val principal = credentials?.let { authenticationFunction(call, it) } - provider.pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> - val credentials = call.request.apiKeyAuthenticationCredentials(apiKeyName, apiKeyLocation) - val principal = credentials?.let { authenticate(call, it) } + val cause = when { + credentials == null -> AuthenticationFailedCause.NoCredentials + principal == null -> AuthenticationFailedCause.InvalidCredentials + else -> null + } - val cause = when { - credentials == null -> AuthenticationFailedCause.NoCredentials - principal == null -> AuthenticationFailedCause.InvalidCredentials - else -> null - } + if (cause != null) { + context.challenge(apiKeyName, cause) { + call.respond( + UnauthorizedResponse( + HttpAuthHeader.Parameterized( + "API_KEY", + mapOf("key" to apiKeyName), + HeaderValueEncoding.QUOTED_ALWAYS + ) + ) + ) + it.complete() + } + } - if (cause != null) { - context.challenge(apiKeyName, cause) { - // TODO: Verify correct response structure here. - call.respond(UnauthorizedResponse(HttpAuthHeader.Parameterized("API_KEY", mapOf("key" to apiKeyName), HeaderValueEncoding.QUOTED_ALWAYS))) - it.complete() + if (principal != null) { + context.principal(principal) } } + } + + class Configuration internal constructor(name: String?) : AuthenticationProvider.Configuration(name) { + + internal var authenticationFunction: suspend ApplicationCall.(ApiKeyCredential) -> Principal? = { + throw NotImplementedError( + "Api Key auth validate function is not specified. Use apiKeyAuth { validate { ... } } to fix." + ) + } - if (principal != null) { - context.principal(principal) + var apiKeyName: String = "" + + var apiKeyLocation: ApiKeyLocation = ApiKeyLocation.QUERY + + /** + * Sets a validation function that will check given [ApiKeyCredential] instance and return [Principal], + * or null if credential does not correspond to an authenticated principal + */ + fun validate(body: suspend ApplicationCall.(ApiKeyCredential) -> Principal?) { + authenticationFunction = body } } } -fun ApplicationRequest.apiKeyAuthenticationCredentials(apiKeyName: String, apiKeyLocation: ApiKeyLocation): ApiKeyCredential? { - val value: String? = when(apiKeyLocation) { +fun Authentication.Configuration.apiKeyAuth( + name: String? = null, + configure: ApiKeyAuthenticationProvider.Configuration.() -> Unit +) { + val configuration = ApiKeyAuthenticationProvider.Configuration(name).apply(configure) + val provider = ApiKeyAuthenticationProvider(configuration) + provider.install() + register(provider) +} + +fun ApplicationRequest.apiKeyAuthenticationCredentials( + apiKeyName: String, + apiKeyLocation: ApiKeyLocation +): ApiKeyCredential? { + val value: String? = when (apiKeyLocation) { ApiKeyLocation.QUERY -> this.queryParameters[apiKeyName] ApiKeyLocation.HEADER -> this.headers[apiKeyName] } - when (value) { - null -> return null - else -> return ApiKeyCredential(value) + return when (value) { + null -> null + else -> ApiKeyCredential(value) } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache index bef736de059bb6ad72773543d01aad8b625867b1..1556c44ae58f5628a55705e5619cf8152a2eca08 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache @@ -28,15 +28,16 @@ import io.ktor.features.HSTS {{/featureHSTS}} import io.ktor.gson.GsonConverter import io.ktor.http.ContentType +{{#featureLocations}} import io.ktor.locations.KtorExperimentalLocationsAPI import io.ktor.locations.Locations -import io.ktor.metrics.Metrics +{{/featureLocations}} import io.ktor.routing.Routing import java.util.concurrent.TimeUnit -import io.ktor.util.KtorExperimentalAPI {{#hasAuthMethods}} import io.ktor.auth.Authentication import io.ktor.auth.oauth +import io.ktor.metrics.dropwizard.DropwizardMetrics import org.openapitools.server.infrastructure.ApiKeyCredential import org.openapitools.server.infrastructure.ApiPrincipal import org.openapitools.server.infrastructure.apiKeyAuth @@ -44,23 +45,23 @@ import org.openapitools.server.infrastructure.apiKeyAuth {{#generateApis}}{{#apiInfo}}{{#apis}}import {{apiPackage}}.{{classname}} {{/apis}}{{/apiInfo}}{{/generateApis}} -@KtorExperimentalAPI internal val settings = HoconApplicationConfig(ConfigFactory.defaultApplication(HTTP::class.java.classLoader)) object HTTP { val client = HttpClient(Apache) } -@KtorExperimentalAPI +{{#featureLocations}} @KtorExperimentalLocationsAPI +{{/featureLocations}} fun Application.main() { install(DefaultHeaders) - install(Metrics) { + install(DropwizardMetrics) { val reporter = Slf4jReporter.forRegistry(registry) - .outputTo(log) - .convertRatesTo(TimeUnit.SECONDS) - .convertDurationsTo(TimeUnit.MILLISECONDS) - .build() + .outputTo(log) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build() reporter.start(10, TimeUnit.SECONDS) } {{#generateApis}} @@ -82,7 +83,9 @@ fun Application.main() { {{#featureCompression}} install(Compression, ApplicationCompressionConfiguration()) // see http://ktor.io/features/compression.html {{/featureCompression}} + {{#featureLocations}} install(Locations) // see http://ktor.io/features/locations.html + {{/featureLocations}} {{#hasAuthMethods}} install(Authentication) { {{#authMethods}} @@ -117,8 +120,8 @@ fun Application.main() { client = HttpClient(Apache) providerLookup = { ApplicationAuthProviders["{{{name}}}"] } urlProvider = { _ -> - // TODO: define a callback url here. - "/" + // TODO: define a callback url here. + "/" } } {{/bodyAllowed}} @@ -138,8 +141,7 @@ fun Application.main() { {{/generateApis}} - environment.monitor.subscribe(ApplicationStopping) - { + environment.monitor.subscribe(ApplicationStopping) { HTTP.client.close() } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Configuration.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Configuration.kt.mustache index 3b568d21eba9f06f783f2ac1fb866ed8e57ae7e7..a8956ec5905238f2ddcb7d2a2dea8888afe03f91 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Configuration.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Configuration.kt.mustache @@ -8,11 +8,7 @@ import io.ktor.features.deflate import io.ktor.features.gzip import io.ktor.features.minimumSize import io.ktor.http.HttpMethod -import io.ktor.util.KtorExperimentalAPI -import java.time.Duration -import java.util.concurrent.Executors - -import {{packageName}}.settings +import java.util.concurrent.TimeUnit {{#featureCORS}} /** @@ -49,7 +45,7 @@ internal fun ApplicationCORSConfiguration(): CORS.Configuration.() -> Unit { */ internal fun ApplicationHstsConfiguration(): HSTS.Configuration.() -> Unit { return { - maxAge = Duration.ofDays(365) + maxAgeInSeconds = TimeUnit.DAYS.toSeconds(365) includeSubDomains = true preload = false @@ -82,7 +78,6 @@ internal fun ApplicationCompressionConfiguration(): Compression.Configuration.() {{/featureCompression}} // Defines authentication mechanisms used throughout the application. -@KtorExperimentalAPI val ApplicationAuthProviders: Map<String, OAuthServerSettings> = listOf<OAuthServerSettings>( {{#authMethods}} {{#isOAuth}} @@ -109,6 +104,3 @@ val ApplicationAuthProviders: Map<String, OAuthServerSettings> = listOf<OAuthSer // defaultScopes = listOf("public_profile") // ) ).associateBy { it.name } - -// Provides an application-level fixed thread pool on which to execute coroutines (mainly) -internal val ApplicationExecutors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4) diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache index 610f48203aa07349f340f7c57f973310cd880182..88935be1e5d4e1de9eea2423e12cecdce7811dad 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/Paths.kt.mustache @@ -3,6 +3,7 @@ package {{packageName}} import io.ktor.locations.KtorExperimentalLocationsAPI import io.ktor.locations.Location +import {{packageName}}.models.* {{#imports}}import {{import}} {{/imports}} @@ -11,7 +12,6 @@ object Paths { {{#apis}} {{#operations}} {{#operation}} - {{^bodyAllowed}} /** * {{summary}} * {{#unescapedNotes}}{{.}}{{/unescapedNotes}} @@ -20,7 +20,6 @@ object Paths { @KtorExperimentalLocationsAPI @Location("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{^required}}? = null{{/required}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - {{/bodyAllowed}} {{/operation}} {{/operations}} {{/apis}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache index 4c34e8f6bf2d49eab04fea1d59ef19e1a2fa8e65..f12148e1d394b892ed47687b1dad5ed162554247 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache @@ -8,8 +8,8 @@ Generated by OpenAPI Generator {{generatorVersion}}{{^hideGenerationTimestamp}} ## Requires -* Kotlin 1.3.21 -* Gradle 4.9 +* Kotlin 1.4.31 +* Gradle 6.8.2 ## Build diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_api_body.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_api_body.mustache index 9dcf500f49be78bbc93c2d44b4dfaa5345ef1f7c..b29afdb0adf2b66ff9954d4b42ab6662f3a6cc64 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_api_body.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_api_body.mustache @@ -1,17 +1,13 @@ {{#hasAuthMethods}} {{>libraries/ktor/_principal}} -if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) -} else { - {{#examples}} - {{#-first}} - {{#lambda.indented}}{{>_response}}{{/lambda.indented}} - {{/-first}} - {{/examples}} - {{^examples}} - call.respond(HttpStatusCode.NotImplemented) - {{/examples}} -} +{{#examples}} +{{#-first}} +{{#lambda.indented}}{{>_response}}{{/lambda.indented}} +{{/-first}} +{{/examples}} +{{^examples}} +call.respond(HttpStatusCode.NotImplemented) +{{/examples}} {{/hasAuthMethods}} {{^hasAuthMethods}} {{#examples}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache index d49c5d537f016c4d44a4d023aa9784e832656b36..09ae65906ea275591a748361474a0d5cdfa2cc97 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache @@ -1,11 +1,11 @@ {{#authMethods}} {{#isBasic}} -val principal = call.authentication.principal<UserIdPrincipal>() +val principal = call.authentication.principal<UserIdPrincipal>()!! {{/isBasic}} {{#isApiKey}} -val principal = call.authentication.principal<ApiPrincipal>() +val principal = call.authentication.principal<ApiPrincipal>()!! {{/isApiKey}} {{#isOAuth}} -val principal = call.authentication.principal<OAuthAccessTokenResponse>() +val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! {{/isOAuth}} {{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_response.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_response.mustache index fb26fb4a7f1bbc9be4dbc7ffcf84da8b2b450e94..931dad98f5e1cd946ed13e1f63d0ebdda3ebd4f5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_response.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_response.mustache @@ -1,7 +1,7 @@ val exampleContentType = "{{{contentType}}}" val exampleContentString = """{{&example}}""" -when(exampleContentType) { +when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/api.mustache index 881e3b108ec3d85fda913ce320bdc61e2ea13943..a3d8c124e817103a993654fe31320683042736ac 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/api.mustache @@ -10,17 +10,29 @@ import io.ktor.auth.OAuthAccessTokenResponse import io.ktor.auth.OAuthServerSettings import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get import io.ktor.response.respond import io.ktor.response.respondText import io.ktor.routing.Route +{{#featureLocations}} +import {{packageName}}.Paths +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.locations.post +import io.ktor.locations.put +import io.ktor.locations.options +import io.ktor.locations.head +{{/featureLocations}} +{{^featureLocations}} +import io.ktor.routing.delete +import io.ktor.routing.get import io.ktor.routing.post import io.ktor.routing.put +import io.ktor.routing.options +import io.ktor.routing.head import io.ktor.routing.route +{{/featureLocations}} -import {{packageName}}.Paths import {{packageName}}.infrastructure.ApiPrincipal @@ -28,34 +40,33 @@ import {{packageName}}.infrastructure.ApiPrincipal {{/imports}} {{#operations}} + {{#featureLocations}} @KtorExperimentalLocationsAPI + {{/featureLocations}} fun Route.{{classname}}() { val gson = Gson() val empty = mutableMapOf<String, Any?>() {{#operation}} - {{#bodyAllowed}} - + {{#hasAuthMethods}} + {{#authMethods}} + authenticate("{{{name}}}") { + {{/authMethods}} + {{/hasAuthMethods}} + {{^featureLocations}} route("{{path}}") { - {{#hasAuthMethods}} - {{#authMethods}} - authenticate("{{{name}}}") { - {{/authMethods}} - {{/hasAuthMethods}} {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}} { {{#lambda.indented_12}}{{>libraries/ktor/_api_body}}{{/lambda.indented_12}} } - {{#hasAuthMethods}} - } - {{/hasAuthMethods}} } - {{/bodyAllowed}} - {{^bodyAllowed}} - - {{! NOTE: Locations can be used on routes without body parameters.}} - {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}<Paths.{{operationId}}> { _: Paths.{{operationId}} -> + {{/featureLocations}} + {{#featureLocations}} + {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}<Paths.{{operationId}}> { {{#lambda.indented_8}}{{>libraries/ktor/_api_body}}{{/lambda.indented_8}} } - {{/bodyAllowed}} + {{/featureLocations}} + {{#hasAuthMethods}} + } + {{/hasAuthMethods}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache index 08c317ea6669f8a098941a505535f11aeef6be13..173686fdf88d5240d092ada4baa6235588f34ff7 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache @@ -2,13 +2,13 @@ group '{{groupId}}' version '{{artifactVersion}}' wrapper { - gradleVersion = '4.9' + gradleVersion = '6.8.2' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.3.21' - ext.ktor_version = '1.1.3' + ext.kotlin_version = '1.4.31' + ext.ktor_version = '1.5.2' ext.shadow_version = '2.0.3' repositories { @@ -29,7 +29,7 @@ apply plugin: 'application' mainClassName = "io.ktor.server.netty.DevelopmentEngine" -// Initialization order with shadow 2.0.1 and Gradle 4.3 is weird. +// Initialization order with shadow 2.0.1 and Gradle 6.8.2 is weird. // See https://github.com/johnrengelman/shadow/issues/336#issuecomment-355402508 apply plugin: 'com.github.johnrengelman.shadow' @@ -59,7 +59,10 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "io.ktor:ktor-server-netty:$ktor_version" compile "io.ktor:ktor-metrics:$ktor_version" + compile "io.ktor:ktor-auth:$ktor_version" +{{#featureLocations}} compile "io.ktor:ktor-locations:$ktor_version" +{{/featureLocations}} compile "io.ktor:ktor-gson:$ktor_version" compile "io.ktor:ktor-client-core:$ktor_version" compile "io.ktor:ktor-client-apache:$ktor_version" diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/licenseInfo.mustache index 3a547de74bb7a2be286e81242b14c95c0f560690..d890606a94ffa1f2ef6fa7663aae9c902304d980 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/licenseInfo.mustache @@ -1,11 +1,11 @@ /** -* {{{appName}}} -* {{{appDescription}}} -* -* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} -* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/model_doc.mustache index ff7358618ea5a55edb751b1dc73283b9b5dfa5dd..3f7c8263df2096e25f06136adee7c2d6189024f0 100644 --- a/modules/openapi-generator/src/main/resources/python/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_doc.mustache @@ -28,9 +28,9 @@ Name | Type | Description | Notes {{#optionalVars}} **{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} {{/optionalVars}} -{{#additionalPropertiesType}} -**any string name** | **{{additionalPropertiesType}}** | any string name can be used but the value must be the correct type | [optional] -{{/additionalPropertiesType}} +{{#additionalProperties}} +**any string name** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | any string name can be used but the value must be the correct type | [optional] +{{/additionalProperties}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache index 88ae5df9f1218fd612aeeabf0fa8c6b494e836c6..0e5ff25b97fbbb7afc526e54b494fd1c512b2244 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache @@ -60,7 +60,7 @@ {{/optionalVars}} } -{{#additionalPropertiesType}} +{{#additionalProperties}} @cached_property def additional_properties_type(): """ @@ -72,11 +72,11 @@ lazy_import() {{/-first}} {{/imports}} - return ({{{additionalPropertiesType}}},) # noqa: E501 -{{/additionalPropertiesType}} -{{^additionalPropertiesType}} + return ({{{dataType}}},) # noqa: E501 +{{/additionalProperties}} +{{^additionalProperties}} additional_properties_type = None -{{/additionalPropertiesType}} +{{/additionalProperties}} _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache index 9b298379710ca9666c86885963dbd41d21de7de4..ca0505ead969b097ff38929258edf1d11cff11ad 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache @@ -10,7 +10,52 @@ '_additional_properties_model_instances', ]) -{{> model_templates/method_init_shared }} + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """{{classname}} - a model defined in OpenAPI + + Keyword Args: +{{#requiredVars}} +{{#defaultValue}} + {{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 +{{/defaultValue}} +{{^defaultValue}} + {{name}} ({{{dataType}}}):{{#description}} {{{description}}}{{/description}} +{{/defaultValue}} +{{/requiredVars}} +{{> model_templates/docstring_init_required_kwargs }} +{{#optionalVars}} + {{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501 +{{/optionalVars}} + """ + +{{#requiredVars}} +{{#defaultValue}} + {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) +{{/defaultValue}} +{{/requiredVars}} + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) constant_args = { '_check_type': _check_type, @@ -19,28 +64,18 @@ '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { -{{#requiredVars}} - '{{name}}': {{name}}, -{{/requiredVars}} - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache index 6b1013ca997d43067178ab8a0d95abd72b28c993..de7887ebdbda289fe9cc51054651c264a1d58f5d 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache @@ -4,27 +4,43 @@ self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -34,13 +50,12 @@ return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: diff --git a/modules/openapi-generator/src/main/resources/python/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/model_utils.mustache index fb60afb60d6f842f79e4c7e33582305e3939da24..3621a5eec51b501a1fb55b3b58040172e0fb5774 100644 --- a/modules/openapi-generator/src/main/resources/python/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_utils.mustache @@ -1302,8 +1302,13 @@ def get_allof_instances(self, model_args, constant_args): self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1311,20 +1316,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1384,31 +1377,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1465,24 +1436,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1495,47 +1450,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1579,36 +1521,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinModelCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinModelCodegenTest.java index 6885057c1c04f9fc3fd1d9043cea9e74d5d6f7a8..19829496e2399c778bbbcb4b195bf9686d550f6a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinModelCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinModelCodegenTest.java @@ -9,6 +9,7 @@ import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.languages.AbstractKotlinCodegen; import org.openapitools.codegen.languages.KotlinClientCodegen; import org.openapitools.codegen.languages.KotlinServerCodegen; +import org.openapitools.codegen.languages.KotlinServerDeprecatedCodegen; import org.openapitools.codegen.languages.KotlinSpringServerCodegen; import org.openapitools.codegen.languages.KotlinVertxServerCodegen; import org.testng.annotations.DataProvider; @@ -28,6 +29,7 @@ public class KotlinModelCodegenTest { return new Object[][]{ {new KotlinClientCodegen()}, {new KotlinServerCodegen()}, + {new KotlinServerDeprecatedCodegen()}, {new KotlinSpringServerCodegen()}, {new KotlinVertxServerCodegen()}, }; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java index 7beb3ec69c0df25a1a03f66a270213fd83321968..fc7d74074dd8b90fce75282d9ce11f64a5a527ac 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java @@ -19,7 +19,7 @@ package org.openapitools.codegen.options; import com.google.common.collect.ImmutableMap; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.PythonLegacyClientCodegen; +import org.openapitools.codegen.languages.PythonClientCodegen; import java.util.Map; @@ -30,6 +30,8 @@ public class PythonClientOptionsProvider implements OptionsProvider { public static final String PACKAGE_URL_VALUE = ""; public static final String USE_NOSE_VALUE = "false"; public static final String RECURSION_LIMIT = "1200"; + public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "false"; + public static final String PYTHON_ATTR_NONE_IF_UNSET = "false"; @Override public String getLanguage() { @@ -39,16 +41,17 @@ public class PythonClientOptionsProvider implements OptionsProvider { @Override public Map<String, String> createOptions() { ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>(); - return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) + return builder.put(PythonClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) - .put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true") .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.LIBRARY, "urllib3") - .put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE) - .put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) + .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT) + .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE) + .put(PythonClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) + .put(PythonClientCodegen.PYTHON_ATTR_NONE_IF_UNSET, PYTHON_ATTR_NONE_IF_UNSET) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..90e76caea16f41413e7104c0eaa9f0f2f0da55c1 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java @@ -0,0 +1,59 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.options; + +import com.google.common.collect.ImmutableMap; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.PythonLegacyClientCodegen; + +import java.util.Map; + +public class PythonLegacyClientOptionsProvider implements OptionsProvider { + public static final String PACKAGE_NAME_VALUE = "swagger_client_python"; + public static final String PROJECT_NAME_VALUE = "swagger-client-python"; + public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; + public static final String PACKAGE_URL_VALUE = ""; + public static final String USE_NOSE_VALUE = "false"; + public static final String RECURSION_LIMIT = "1200"; + + @Override + public String getLanguage() { + return "python"; + } + + @Override + public Map<String, String> createOptions() { + ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>(); + return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) + .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) + .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) + .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) + .put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true") + .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") + .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") + .put(CodegenConstants.LIBRARY, "urllib3") + .put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE) + .put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java index 8bec98892ef69c816ad77bbc99239d5c79baa5f3..e423c6e858426127742a1abeaae83890786253c7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java @@ -19,7 +19,7 @@ package org.openapitools.codegen.python; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.PythonLegacyClientCodegen; +import org.openapitools.codegen.languages.PythonClientCodegen; import org.openapitools.codegen.options.PythonClientOptionsProvider; import org.testng.Assert; @@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; public class PythonClientOptionsTest extends AbstractOptionsTest { - private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings); + private PythonClientCodegen clientCodegen = mock(PythonClientCodegen.class, mockSettings); public PythonClientOptionsTest() { super(new PythonClientOptionsProvider()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java new file mode 100644 index 0000000000000000000000000000000000000000..8c17cdbb2fd87ae36663ca2508b35a95155bafd7 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.python; + +import org.openapitools.codegen.AbstractOptionsTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.PythonLegacyClientCodegen; +import org.openapitools.codegen.options.PythonLegacyClientOptionsProvider; +import org.testng.Assert; + +import java.io.File; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class PythonLegacyClientOptionsTest extends AbstractOptionsTest { + private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings); + + public PythonLegacyClientOptionsTest() { + super(new PythonLegacyClientOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void verifyOptions() { + Assert.assertEquals(clientCodegen.packagePath(), PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar)); + + verify(clientCodegen).setPackageName(PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setProjectName(PythonLegacyClientOptionsProvider.PROJECT_NAME_VALUE); + verify(clientCodegen).setPackageVersion(PythonLegacyClientOptionsProvider.PACKAGE_VERSION_VALUE); + verify(clientCodegen).setPackageUrl(PythonLegacyClientOptionsProvider.PACKAGE_URL_VALUE); + verify(clientCodegen).setUseNose(PythonLegacyClientOptionsProvider.USE_NOSE_VALUE); + } +} diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml index 9e9451dcc5be137edc4a38108f6e1a7d08b4c5ae..097ae6768bb73cdc19d1d66bdd62113f29be46fe 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1373,8 +1373,6 @@ definitions: properties: breed: type: string - additionalProperties: false - additionalProperties: false Cat: allOf: - $ref: '#/definitions/Animal' @@ -1523,8 +1521,7 @@ definitions: type: object additionalProperties: type: array - items: - type: object + items: {} map_map_string: type: object additionalProperties: @@ -1535,14 +1532,15 @@ definitions: type: object additionalProperties: type: object - additionalProperties: - type: object - anytype_1: - type: object - anytype_2: {} + additionalProperties: {} + anytype_1: {} + anytype_2: + description: no type is set for this anytype_3: type: object properties: {} + description: 'because of a bug in swagger-parser, this should have values {str: (str, int, float...)} + but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378' AdditionalPropertiesString: type: object properties: @@ -2091,7 +2089,6 @@ definitions: properties: interNet: type: boolean - additionalProperties: false GrandparentAnimal: type: object required: diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index a1e07d488bdf93d1a458fc3a4ef291f61d20538a..27b97c89d8cfb59d7619cac6aab7cdbf81f71249 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1646,7 +1646,6 @@ components: Cat: allOf: - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Address' - type: object properties: declawed: @@ -2107,6 +2106,9 @@ components: items: type: object nullable: true + object_nullable: + type: object + nullable: true object_nullable_prop: type: object nullable: true @@ -2124,18 +2126,27 @@ components: type: object nullable: true additionalProperties: - type: object nullable: true + ComposedSchemaWithPropsAndNoAddProps: + properties: + color: + type: string + allOf: + - $ref: '#/components/schemas/Tag' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + # This definition will only allow in object payloads that set color and no other properties because + # additionalProperties are evaluated at the schema level and do not include composed schema + # properties. Only color is defined here, all others are additional + additionalProperties: false fruit: + description: a schema that tests oneOf and includes a schema level property properties: color: type: string oneOf: - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' - # Below additionalProperties is set to false to validate the use - # case when a composed schema has additionalProperties set to false. - additionalProperties: false apple: type: object properties: @@ -2145,12 +2156,16 @@ components: origin: type: string pattern: /^[A-Z\s]*$/i + required: + - cultivar nullable: true banana: type: object properties: lengthCm: type: number + required: + - lengthCm mammal: oneOf: - $ref: '#/components/schemas/whale' @@ -2210,13 +2225,13 @@ components: anyOf: - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' - additionalProperties: false fruitReq: + description: a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas + also, this schem accepts null as a value oneOf: - type: 'null' - $ref: '#/components/schemas/appleReq' - $ref: '#/components/schemas/bananaReq' - additionalProperties: false appleReq: type: object properties: @@ -2320,7 +2335,6 @@ components: allOf: - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' - additionalProperties: false ScaleneTriangle: allOf: - $ref: '#/components/schemas/ShapeInterface' diff --git a/pom.xml b/pom.xml index 9e32caa32aa47ab375680875c5aadb9c3e73c0a1..01940dccf7ad8e8e8fee60787fc4862f3f483200 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ <packaging>pom</packaging> <name>openapi-generator-project</name> <!-- RELEASE_VERSION --> - <version>5.1.1</version> + <version>5.2.0-SNAPSHOT</version> <!-- /RELEASE_VERSION --> <url>https://github.com/openapitools/openapi-generator</url> <scm> @@ -1206,6 +1206,7 @@ <!--<module>samples/client/petstore/javascript-apollo</module>--> <module>samples/client/petstore/javascript-flowtyped</module> <module>samples/client/petstore/python</module> + <module>samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent</module> <module>samples/client/petstore/python-legacy</module> <module>samples/client/petstore/python-asyncio</module> <module>samples/client/petstore/python-tornado</module> diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index aee3c61f9dc01967030ee6f46644b42eecb7f2cd..cb51123c894db585c4d95bc01bca1214d29a3728 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 3fb863be6c31fab4978155f6a2ed73df6e270d65..46e2f100ef294e5e50be1ad10f449a7efcf38bd0 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index a60b978a01daebd96fa1e53fe2e0bb17fede557b..52554ff63c7b72c65ecf82b1a75444004d2d8058 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index 4bbbc82d19d8bca4914b48d6e23a05f3ca219a61..74c298a5a94c72a17019a967988ea0c7988e3b8e 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index 587302df0f4adbbeb137a81779404b3bed915f07..bfae070986eee0c21effdc2ced5b6e06ceb585d2 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index a07cb2886eebc4d25bee9a5ce3d595dff721dee3..cd7915e04e0d8c2627de1a0a5ef7ace5e8d1a609 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 31b2074889b79c50ef13bf0794bcc324d98367fd..9de06a9eea1e8922a83b886bf0d30912c9c18966 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index 9f63c2171606b5d469d2a5b802bcd4651036e598..ffba49f782a86ad2d9c31b4b82ed277ab2059145 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 68403ab6e56db4c8afcb6b5cdecc438ab3b2dc88..1a1b0a55e908e2a54285ac94721a4245d3bf30be 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index 75bb6c83cb67c03734535a0c04f005041317d680..658ef28191c8e1d5f51e75d37f32f2bb5453081e 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index 7c521220a29cedd70f923c5199f229b49e6ecde7..f9717b9c9beaa243ac00ae5d750da8acb8f804a9 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 5a183729603883426f40a64d6251266b09426847..4803353fa2c669b50fe54786d8c5a5306aeef93b 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 1efa72dea2c897da79578bad753675b8b15cc455..417c04a69e0c189cdeb840d47f0cef1947c8abf2 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index 5ba899102e9967f5cf3e841b19b99939f4d83ffd..c6c22d58185683522fc19718f36190292e7742bc 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 0ec4344fac8e62c6c9b13763547c449ba6be89c4..ea1f59b31a4188971dceafb485179b10e38b5ad9 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index e168728a5504d2b8a2b752781e52c87ac29e4b30..0c05fe80e4bbb39868c726b183d839046ee92069 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index 4f24052e5be383b20ea4fc9ee024e482ee42c88e..fcb51a1da3b4c526c3f4f94195a8b9a19a15bd05 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index a5e2fc91fc9dcc1ce3c77f9fb3d335dfc94e4ace..fe9bcacf4582e1af24cd951e5d50b844665cb9a0 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index 0cb38bd28c38888d961cd87296b4917993a054ca..694cde1512ccf222fc6dd6f0ed2f7e9e6afbd304 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index 3d1dbc21292a9461e4c4beafb91023c7964db698..b60e41cfcfceb432daf2bd30a8a1e911011d82a3 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index 37dc0e7914ea6f43a4ec550a1713963bf5eb6ca8..c5241a6e2d8ddea4de2e1c6a90e7a0bd7961f31b 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index b562a62781f6e3e0c16c3562c4342ca1d94cc215..4927b6785ecb29833022f363c9fdee512d4c7818 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index 43b9b21a1926f7e6b60f9fd79cb0450913a8f738..c4aa9ed60249fbc961534cf56c1f9da1d0244633 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index a00af3e69060ef9e4e810aaa4e54acf6b18d2e4a..e43dcecded18555b0aab32f9f373d0e270e4a380 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index feef2b4e3aa2eaaf4d135393b72557a548269199..f892cedb7f87f441c976a7af968506e2ef579de5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 4c8474c8288eba612189887f72776c57f7898940..38ee7a831309a026509a0e885a1f25511152c5ed 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index f48a03d19522972bc6e72ffda37fa33efb83bcd8..5aab92bf04d41124f63c27c820cdb7696a55c23e 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index 9dd76252a7db5818d45457003a3e08b4a957c28e..17f40a62a73d574e61118c4147d389d95abfdfd5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 5b31e77553a791bcede3db0a131acbc1355ce680..dbe4b2cb7745643a710f96abb6d6600dcaff180d 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index 798d5286d40064193b2265e50ddf8a7ce1ba6f95..e7e6228a95f74c0aed34e8820197555b0d80df84 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index cd9843e18ae4ff2ae66c3bbb48c5c40da2516fbf..543a4fed12e5eddd59c71c6c15fa0631fbcb45d4 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index 175703246bd164900c13b149564f0439e4612d7d..401b81b68931142aa515ea812b576c311eb28a7c 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index c10ffe79433fba58a9a9aac3dd25163ede5e90bd..f183c7adf9d8b61671120eafe260d0d58b1e42c3 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 2b4e5194602f8a2a13ec581077c0b45156f60957..3065eb0b5542c8909ad2570cd8001ccf9fa0253b 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index 9b2e0d7b983d3a7a40b16754bbccf8ed2cea27e6..731b2517d6d1af870d1381a5697c279ce8c735a0 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.2.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/crystal/.openapi-generator/VERSION b/samples/client/petstore/crystal/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/crystal/.openapi-generator/VERSION +++ b/samples/client/petstore/crystal/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/crystal/.travis.yml b/samples/client/petstore/crystal/.travis.yml index 03fe6908f221ed74241f5450ca9d93469aea1f3d..b40e33fb20e5df2d1f1d7e38b6dd8557420c3d80 100644 --- a/samples/client/petstore/crystal/.travis.yml +++ b/samples/client/petstore/crystal/.travis.yml @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # language: crystal diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index 8e6463d1dc6c9e043e82faf11a2855530182a1a7..6532505ff2b2a109e8028c0ac63ec591093f1480 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # # load modules diff --git a/samples/client/petstore/crystal/src/petstore.cr b/samples/client/petstore/crystal/src/petstore.cr index 2714eeb12a21da0874a4a3baab04a108018176b6..1f02cc1930dfcd53ccb1b00489f4c3037022387b 100644 --- a/samples/client/petstore/crystal/src/petstore.cr +++ b/samples/client/petstore/crystal/src/petstore.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # # Dependencies diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index e09038a5ba916d2ec2560685f69be0415ed2e215..7e672a21a61320ec6b118270a4c7e8e76d5b619c 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 4be9e250868e4a96f4ddde17bd95e002c1c3ce00..126dbab7bf429f217300cf9216c9dd2fdc0fbd18 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index 5ba42511c13def924e3727761a787bd68e379f74..2b6d6acdace5e0239cfcbde592d40f3a3323bcff 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api_client.cr b/samples/client/petstore/crystal/src/petstore/api_client.cr index 7e241a63aa36eb8b758cc54c32c6188bec119140..75fe8faa20325dd41db75b227fdc449bfde0e1eb 100644 --- a/samples/client/petstore/crystal/src/petstore/api_client.cr +++ b/samples/client/petstore/crystal/src/petstore/api_client.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index b21ef0e666dabf6f577509700985ab8355df536d..ef28c709d56a801e138c4ef8b9f97dd2c9ebebe0 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # module Petstore diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index 1d58733f2a405014680b1c02a6926f51971d9892..780228391592bcbed209aa9fb90abdf4a70ffda7 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "log" diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index e78afdcab44bd4bdae9b9894d4c4238e8705cd0e..b0603e98c0325051be2630c7fd24d195c6ed9203 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 8028347a310b90949858e538cbcf19ba3142583a..d96bac1cf1c61c806775256f5fe700c6d9c59026 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 49683b627394f6fbde7dcba2d04250c8704cf0b6..ee5a4356492af90259b6393f103e8b0be60bcade 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index 8052f0738259882d4eccb417ab8453209fcce63a..91e5552b02e94174291cbdc1a29a155269bfffad 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index e65ea328c3f168c2a30120a3a66638c4061babef..4121f2e67a789825a3ff90ac5382911d1e2f1b2a 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index 0a63ffb9f012280f9a2d9a4239eef955b4d9fdd3..4f0d617e98dd75cae12e1f78b26191be5af89666 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.1.1 +#OpenAPI Generator version: 5.2.0-SNAPSHOT # require "time" diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/.openapi-generator/VERSION b/samples/client/petstore/java/native-async/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 2264e521b0f33aa82cad5ecee0b25eafa6eb65f2..82512bbbbfc13122e85fa27eddc53b7da2832e15 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index e97921554ead14d01026ba59272b126058b1edd4..32aaff8894b4c26a6baf335ae5c0d5d24813fb9a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index c9508eb5f7ee4342296c545762da2e18f0d50475..69ea9500cde8ca32c38f4ff4f61762935398d025 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 3980c298966296183891427d117077e93fd92841..2958cadbd4dc82eb29581b2dec419f5b4670f97c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 0978717a70fe5511466f939f48ab374781ecbb03..55665ac20ad9ba0463f43f15851802ffcaad0c4d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index bbe64b82b5925cb197507d3bb099efb597fcc4f1..30af05a38c949221b0c65874ef7a5a7886ce1723 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 93a504be879c744e9ebcda4a9b06b0933524fa64..9ca62c9a05d914c6f09d38671faf8fa76a0027d5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 1ea0d8316d545865bd1f93617ec07a095286e1da..e997b629e9be60524754e68d73abb1afef89cd5d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 2e5212335a99300d0af29bafa946ea2ee9cd313c..b252ae5ef72e90bf34a0de1dc9829767952f462f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index bec2819300306f94c7151e908e09985f385f9e0e..f6c880c66d4aa0576d53e531a96e2d0a41c04487 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index dd92145054b8dfab5dffffb351acb0f1326cdb05..f17a767e8c1dc1f250f4be2409a40347c62ab241 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 1b19bd4761c0c39db2f4976ae9b9fc0676b6f3c7..5b573b955ddf0206391085c5539cda44d60fe0b0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 6a2266fd1d7575f99b6e5ea23d1fdb3e6aacf88e..98a7e1675c1eec94afd856be9016f2166e13c49b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 5689f1f085dab31ddc3d8cbc31d11f908176e4b8..7e5efea61b062be57cd43f625cac3319f434e011 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 2fd9bf4f16c2f1a609efdbefb658e047f702a799..fdb9ab4d80b575346225a9370bc7403a76476a97 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index a1d5f03cbfdca6a39b854b4b2c5d493176503db6..e882d134f8d04375bf57f6026fe5664dee55c5c2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index fc75181fc93c3f7ca0a6591cee279016dc6e5bcf..a817d7fc271c90ef6cec2e49f9f69d6ef4c50496 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 95407a7b882b74c629c0fae6b1a413de9399b6d3..789214ceee7497424c147f7bf3afed8bbef25983 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index f57dda054aa711f892d10fef620c319edeaf145f..c28e30e064778c779ad042e3fefa6cadc80d7d01 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 6f8ce10190d2bd51fdc7a8795606a6e4a4965b02..fe14739688bfeebc06234fd50040ef1bf88e3c92 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 9f4c356f2569953326ba9c78c8978f6df453e927..5c572564fcfabe060cf53d4b3837f94faa8a6fc1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5acbc0e2749263594e49791d28291baa4cdbcfd4..c9296011f4904ffc1d2396df2dd1cebfb7ee0872 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index f5a46e2188739905b365c8393bf47f9daaf4b84c..69ad47d8bc7819ed441fa8f7b3f374459a2eb516 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 055ed63c376ef12df8f9c17ce98f43ee2c2b9cd3..8749ebfb71e6563e7f4ef2d886e1c3d71d2ece13 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index c9000c137ed46df4fc21f5485cf8fd2c8e88c7e3..89dee9f0bc0ae772c221f6c4ba918a7303fba837 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 339ab035ab6ddec5bcb6c28d6e07cd1b72d4f064..2581be3f148546090b57f1fc2f661b1fd4fa0fe9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bd4c36298b43e8a9b2400f5035d16db693bf9de7..f332f71f424dfad892d4fd424919379e559e4b71 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 241523e9eff09bb01d0e16ef2f01aa8e5d720bbd..843efaf3eaee2c4dceab5ae891e20d72fa7ea4a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index aec24769b0b050c4b8a6f520bdd7ac89ce605ca8..65eaad6cfa813e2fbee3dcabbb1296bd4ac2ff3d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 2c14b2f68ca340dd501c21f01ed3c6cd95da54f7..3458c88050b80ae8cb33fc65dac5331735ae0da4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index ed372802828dfd0d770e9ab8f5aad612b390fee8..d42e123e395b2bf5381f2ba165f549dd8451c63b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index c245f6f7057615aa73bb335c9335ef734cde0158..d8453ce363b63e27b7e4aae750498d9f5d9c125c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 5f8d627321b6bca78b3d8557aee585cd21d3a5c9..73eb87f37176f1d6f01cfcccbd4c57044b4efd26 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index 42bd9ea30304cfe22e58a7f31fb927cfeb7a3415..442ebd36dce83ede99ec2b3800cd73d28d0be123 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index ddeece82a4f980b725830c1b448367b1c6f454c9..06b442f7f85a7eacb309205cfc6000c231c05c87 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 9f0719e50d8a70f85d9e3189985a725b41408c59..c0bb79463d6b06f1e3d9e32081b8a79ed1965cb2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index c16987e53cc6cc046d85825b89a42bd385bbf4c5..8208b69e7bdadb7770409ce03bf4a81df42a312e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 24e2178226283e40d27dddb1ed803b490d64e173..1717e0cfc834def504f294511cff8dfd7bb9c1e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 858b33409b68e778f0ca93d88ebb4132b29d29b6..72b9ef4039fa6edae6195b9ba42d6b4d5c755300 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 401c62f2e4fc021736388098f80de67bb8c00bbf..9dcbc31a7154e0814348dbf4ed39e439601441be 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 2dd99e46619b8ed691bac2fa5d7e5a64b56c3e89..7c795f931251c0c4a6979d2fee39b945599dbd3b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index 805089634fb4beb67d8542909cb71209a6674383..5a33a1d812e295abd5af39a336d5e120bb8a7c36 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index ae7b7d006f246e75e37ab107d1334b4a9fb0f725..7d75b5245b238c7f05265e81790bb38367477c76 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 0eada2b8c79229784bd0d5f4b1efd391f4926b81..81561ed34cf7b90137657cbbfff01c70dace211d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index e3654acd835b1cbcc1921d157e9b76d7d8efcc14..9107917c48e80b14788716a8e608494060346b6c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 5e3906d6910280d2456566a6607eadf987aea115..2db56f93296ba527e8da9eadae2d961d9ddf7c5c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index 5635c586621f672eec2edc28db1538780da5494b..53fe34e2b38decb701f13521897aa2b279dd7614 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index bc1634360f35476588f5b3a072e8a56d82097bc3..a79e24efb9719843224c51d64681c14347bf815c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index 1f2683a000bb970d0b090a92f2485ea9e26dc3ec..5316f01f71355234444c0ac45693bfbd0c76aa3c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index bb4cc1f2e4355f8fb982fc3157cebe4b46d7f26e..45138c5731d8e848328e53717d64267a5005111f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 7ca522f83d9f8812d0e55120f7af55905125ac25..3d3021236147932bc7715ff6b67d5542abd4c074 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index a8343418d8345221441760c7888af0da2c83642d..9f75dae4c0a9617ffe679407075b2e6aea3c65a5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 79aae3dbf53199df48e9aaeaab2415617e923d75..cde888641f40b653e0518b5ffaf1afc1e07ce62d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 1e0eb56e78fe7d076608242d282032a6e13cf253..51cff7e4eb4298eeb3c0ec63cfacc79ee058fbd0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 8fb76516e4375782afafb6e263201df23416a0a3..b3f94cc8a1452f705f04ae9ea48b47da3fc9bd7f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index ec4fb294155a339fef05f0559d8ce642f7e8a5dd..bb58f3bbb9f378a26063c2d0afd07100e49b5260 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.1.1 + * OpenAPI Generator version: 5.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md index a69ff4928f4402e9669348a9244ee64ebee7c1e9..d31d12de08229ff54595fb8e40018dd07fe7a907 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python/docs/AdditionalPropertiesArray.md index 697494b373ff90b5d302f0c5c64bd18c06b7520d..40537cbf8384f3dbb4d98839eb62ed5bc12fecf8 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesArray.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] -**any string name** | **[bool, date, datetime, dict, float, int, list, str]** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md index 3646837b853bad9b03b86e91b7ade04580acca6e..3ba7bab6f3d0eb16d8afceadfef0c7dcdc382e8e 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -9,12 +9,13 @@ Name | Type | Description | Notes **map_integer** | **{str: (int,)}** | | [optional] **map_boolean** | **{str: (bool,)}** | | [optional] **map_array_integer** | **{str: ([int],)}** | | [optional] -**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str],)}** | | [optional] +**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}** | | [optional] **map_map_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}** | | [optional] -**anytype_1** | **bool, date, datetime, dict, float, int, list, str** | | [optional] -**anytype_2** | **bool, date, datetime, dict, float, int, list, str** | | [optional] -**anytype_3** | **bool, date, datetime, dict, float, int, list, str** | | [optional] +**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}** | | [optional] +**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**anytype_2** | **bool, date, datetime, dict, float, int, list, str, none_type** | no type is set for this | [optional] +**anytype_3** | **bool, date, datetime, dict, float, int, list, str, none_type** | because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378 | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python/docs/AdditionalPropertiesObject.md index 73ba59147122516bfb090898947878e315f9fd73..dc64a0d91c2439da3bd3a24523306579d9212af7 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesObject.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] -**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str,)}** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type,)}** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python/docs/Animal.md index 1d1c77c01abc4cb048828b44b4ececc8d677d565..d36c66a5d88213a28a981aabfb05211f9269fad1 100644 --- a/samples/client/petstore/python/docs/Animal.md +++ b/samples/client/petstore/python/docs/Animal.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | **color** | **str** | | [optional] if omitted the server will use the default value of "red" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/AnimalFarm.md b/samples/client/petstore/python/docs/AnimalFarm.md index fc299cf27d342d3499915b0438134d7c16952cfb..fb3b33c9c9c2448a240c2e987e36640e8d05ea3e 100644 --- a/samples/client/petstore/python/docs/AnimalFarm.md +++ b/samples/client/petstore/python/docs/AnimalFarm.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[Animal]**](Animal.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ApiResponse.md b/samples/client/petstore/python/docs/ApiResponse.md index 81a7d0d85227718256a4a53ca8bcbc2096d2f1c8..bedefea9a9cb7b372afbd2c03d71346304243fc2 100644 --- a/samples/client/petstore/python/docs/ApiResponse.md +++ b/samples/client/petstore/python/docs/ApiResponse.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **code** | **int** | | [optional] **type** | **str** | | [optional] **message** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md index 6ab77963788b2634f2b3b1af7455e14488b9a063..11cd25c98ee4f41cb0b80ef2b8a662b0cfb29350 100644 --- a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_array_number** | **[[float]]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md index ebc65a54ba7ef0b656134ccb1aee1cd4b377638b..1e9bb12e4e8bf1c400d76be15e0409e494539677 100644 --- a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_number** | **[float]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ArrayTest.md b/samples/client/petstore/python/docs/ArrayTest.md index 4e1bda8fc3af5d206578dc1c8325b5ab63b86731..9eac1f8874c4c2905084e9b203011d6555ff6849 100644 --- a/samples/client/petstore/python/docs/ArrayTest.md +++ b/samples/client/petstore/python/docs/ArrayTest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] **array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Capitalization.md b/samples/client/petstore/python/docs/Capitalization.md index 1ddeadeb3f463ba78caacd3c75a820ad59ff5fc2..df9989f8db579d0be0621799644f09024bec9d59 100644 --- a/samples/client/petstore/python/docs/Capitalization.md +++ b/samples/client/petstore/python/docs/Capitalization.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **capital_snake** | **str** | | [optional] **sca_eth_flow_points** | **str** | | [optional] **att_name** | **str** | Name of the pet | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Cat.md b/samples/client/petstore/python/docs/Cat.md index e9ce235cd632f90499f0a65f82d882a153e4f98d..082715a28421390d671a191a6546d82746a3503a 100644 --- a/samples/client/petstore/python/docs/Cat.md +++ b/samples/client/petstore/python/docs/Cat.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **class_name** | **str** | | **declawed** | **bool** | | [optional] **color** | **str** | | [optional] if omitted the server will use the default value of "red" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/CatAllOf.md b/samples/client/petstore/python/docs/CatAllOf.md index 0ff7809a99ac07c46854b47e3ebdd750dbc7ab8f..6fd1390a749bb822e1254238497d23b250a25d10 100644 --- a/samples/client/petstore/python/docs/CatAllOf.md +++ b/samples/client/petstore/python/docs/CatAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **declawed** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python/docs/Category.md index 940f6a45e6418f84e5483d84264b461b4dc3306a..7650eccafba5691b7701e2af3fda16c9b8ff1a56 100644 --- a/samples/client/petstore/python/docs/Category.md +++ b/samples/client/petstore/python/docs/Category.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | defaults to "default-name" **id** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Child.md b/samples/client/petstore/python/docs/Child.md index eb4392445710896a5e05af0a442ca4b787011312..6bf6903fb2037cb90e43b7f493bde11f9a707e67 100644 --- a/samples/client/petstore/python/docs/Child.md +++ b/samples/client/petstore/python/docs/Child.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **radio_waves** | **bool** | | [optional] **tele_vision** | **bool** | | [optional] **inter_net** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildAllOf.md b/samples/client/petstore/python/docs/ChildAllOf.md index f9ae99c7c15713d0c7e8d3e4d7e413fab09b6d47..bae8ced900678b3c11130c4499efaf3efebe1957 100644 --- a/samples/client/petstore/python/docs/ChildAllOf.md +++ b/samples/client/petstore/python/docs/ChildAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **inter_net** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildCat.md b/samples/client/petstore/python/docs/ChildCat.md index 9e3a0fb4b51ac85db317617424a175ed2a2ae5ed..513903ac5793ab7d5a5359b15df222bddae68a44 100644 --- a/samples/client/petstore/python/docs/ChildCat.md +++ b/samples/client/petstore/python/docs/ChildCat.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | **name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildCatAllOf.md b/samples/client/petstore/python/docs/ChildCatAllOf.md index c5883b9a87c80c063d04bb4bf33345c6024b4a70..c5b2f58f28ceea2a606d1dc72e387edfa38700a9 100644 --- a/samples/client/petstore/python/docs/ChildCatAllOf.md +++ b/samples/client/petstore/python/docs/ChildCatAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildDog.md b/samples/client/petstore/python/docs/ChildDog.md index 9a6e5b372664b5851981e3289f225bc6fc266e00..e5b410ce1e79963e3726f7a6830555a6c237c62d 100644 --- a/samples/client/petstore/python/docs/ChildDog.md +++ b/samples/client/petstore/python/docs/ChildDog.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | **bark** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildDogAllOf.md b/samples/client/petstore/python/docs/ChildDogAllOf.md index 673050667cb3ab7f67164a908017033ad853be9f..45928c57ef2a8015cd5d2c723449471322b425bf 100644 --- a/samples/client/petstore/python/docs/ChildDogAllOf.md +++ b/samples/client/petstore/python/docs/ChildDogAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bark** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildLizard.md b/samples/client/petstore/python/docs/ChildLizard.md index e881ee0a1d1b0ecd5a500761ec78299ac3466e36..d2e22826e77fd7e522e917a482dfe4cbd072cfc0 100644 --- a/samples/client/petstore/python/docs/ChildLizard.md +++ b/samples/client/petstore/python/docs/ChildLizard.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | **loves_rocks** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ChildLizardAllOf.md b/samples/client/petstore/python/docs/ChildLizardAllOf.md index 6e2b70c01505e59d38e7bd1590e3ed07a7e50560..6effcfd9313fc324796c656cf57e0d00614e0341 100644 --- a/samples/client/petstore/python/docs/ChildLizardAllOf.md +++ b/samples/client/petstore/python/docs/ChildLizardAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **loves_rocks** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ClassModel.md b/samples/client/petstore/python/docs/ClassModel.md index 48ed7cbf2ff0c35fd1e04db8a094eb2fdeddf1f9..6605a16d74a9f3877b71a4166f0b9f182f08be1c 100644 --- a/samples/client/petstore/python/docs/ClassModel.md +++ b/samples/client/petstore/python/docs/ClassModel.md @@ -6,6 +6,7 @@ Model for testing model with \"_class\" property Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_class** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Client.md b/samples/client/petstore/python/docs/Client.md index c3986008d6c37dcb94e62691067f468b8b196e6f..1b293140f3487262baccaae6ec26c86646fb230c 100644 --- a/samples/client/petstore/python/docs/Client.md +++ b/samples/client/petstore/python/docs/Client.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Dog.md b/samples/client/petstore/python/docs/Dog.md index 7065c4c983d95919495d62719cd703ba21fc9dc4..51b5b32bdacbb39c4334b2fa18b7c3f2db6a1323 100644 --- a/samples/client/petstore/python/docs/Dog.md +++ b/samples/client/petstore/python/docs/Dog.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **class_name** | **str** | | **breed** | **str** | | [optional] **color** | **str** | | [optional] if omitted the server will use the default value of "red" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/DogAllOf.md b/samples/client/petstore/python/docs/DogAllOf.md index 6382bbd80671a878eec0d9ea040d6e9958c25ab6..2907a9fd5c4349b0a95c81e0400713c3636d5bd1 100644 --- a/samples/client/petstore/python/docs/DogAllOf.md +++ b/samples/client/petstore/python/docs/DogAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **breed** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/EnumArrays.md b/samples/client/petstore/python/docs/EnumArrays.md index 9be5c645a8099d2df1275940b7c3ab4f4e8bb72c..ad4e9d2fcb7caf088fa0f43184c57bfbb5012905 100644 --- a/samples/client/petstore/python/docs/EnumArrays.md +++ b/samples/client/petstore/python/docs/EnumArrays.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_symbol** | **str** | | [optional] **array_enum** | **[str]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/EnumClass.md b/samples/client/petstore/python/docs/EnumClass.md index a1f9aae5819006fc6b7acd69d196f1e575c97311..39bb0e1644c5016b181209c5d78d5b09a2b0ae5f 100644 --- a/samples/client/petstore/python/docs/EnumClass.md +++ b/samples/client/petstore/python/docs/EnumClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/EnumTest.md b/samples/client/petstore/python/docs/EnumTest.md index eb88422413904dc06649ea020ef169e98419ae40..052596bfd045a7e98ef9856b41bd2b6cfd38a50a 100644 --- a/samples/client/petstore/python/docs/EnumTest.md +++ b/samples/client/petstore/python/docs/EnumTest.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] **string_enum** | [**StringEnum**](StringEnum.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/File.md b/samples/client/petstore/python/docs/File.md index 63b1d1a65186f27d04a99c10a66f7f3d0dde447f..f84547d19331cf3bc4dd6ddad384e8d91c61c37c 100644 --- a/samples/client/petstore/python/docs/File.md +++ b/samples/client/petstore/python/docs/File.md @@ -6,6 +6,7 @@ Must be named `File` for test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **source_uri** | **str** | Test capitalization | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/FileSchemaTestClass.md b/samples/client/petstore/python/docs/FileSchemaTestClass.md index caf2440821daf2c51430b41b1a58ecc049210956..4572aa0905b384502f546dab5deced6c8c7371eb 100644 --- a/samples/client/petstore/python/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/python/docs/FileSchemaTestClass.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **file** | [**File**](File.md) | | [optional] **files** | [**[File]**](File.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/FormatTest.md b/samples/client/petstore/python/docs/FormatTest.md index aef09bfcc83e8afe80acd69406a7e11e049ff97b..dbb4c3e6683d7d7fa661ba91eb4a44c2edc63433 100644 --- a/samples/client/petstore/python/docs/FormatTest.md +++ b/samples/client/petstore/python/docs/FormatTest.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **binary** | **file_type** | | [optional] **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Grandparent.md b/samples/client/petstore/python/docs/Grandparent.md index b6d80a7194575dd4f32848c66348bd421b5143ba..af143938ab513f88e7617b1c39f462a466e46759 100644 --- a/samples/client/petstore/python/docs/Grandparent.md +++ b/samples/client/petstore/python/docs/Grandparent.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **radio_waves** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/GrandparentAnimal.md b/samples/client/petstore/python/docs/GrandparentAnimal.md index 15db0708bb1aa4d4c6492d04330e06c3a4871325..a1c340378106156ab9be4857b084cfe74a81a0d2 100644 --- a/samples/client/petstore/python/docs/GrandparentAnimal.md +++ b/samples/client/petstore/python/docs/GrandparentAnimal.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/client/petstore/python/docs/HasOnlyReadOnly.md index 0e1334519a8b2648cae176dfa8d333ac308c3b6e..88bc03d4ff5c2a5c87940c68931de7b6fd91ba24 100644 --- a/samples/client/petstore/python/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/python/docs/HasOnlyReadOnly.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **str** | | [optional] [readonly] **foo** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/List.md b/samples/client/petstore/python/docs/List.md index 4b60956971aa8983cb144916960189b22430c4a0..13f2694de358defb8ca408c1a4dcbb1673f91e65 100644 --- a/samples/client/petstore/python/docs/List.md +++ b/samples/client/petstore/python/docs/List.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123_list** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/MapTest.md b/samples/client/petstore/python/docs/MapTest.md index 15228ee1f282bc15b37f11748a3a07c394464ae7..e6584f3811e0587a24a17a59dbbb4411328108c2 100644 --- a/samples/client/petstore/python/docs/MapTest.md +++ b/samples/client/petstore/python/docs/MapTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] **indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f489944a20afcb0a08aa61bdc5a2561c4bfa9dfe..f32c4e04134ba3605410a044ebe8020cb8c032f2 100644 --- a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] **map** | [**{str: (Animal,)}**](Animal.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Model200Response.md b/samples/client/petstore/python/docs/Model200Response.md index c958bd4b33f846bbdc6742175b949b4b069012a3..f7ef7d79acf6341615b713a5bf67f966437556d2 100644 --- a/samples/client/petstore/python/docs/Model200Response.md +++ b/samples/client/petstore/python/docs/Model200Response.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **int** | | [optional] **_class** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ModelReturn.md b/samples/client/petstore/python/docs/ModelReturn.md index 043e9d466fab1f75bed067fe12a48fcbcaa44376..75fb39a8869828c8bc4d30586b5f55cc6cdc92f5 100644 --- a/samples/client/petstore/python/docs/ModelReturn.md +++ b/samples/client/petstore/python/docs/ModelReturn.md @@ -6,6 +6,7 @@ Model for testing reserved words Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_return** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Name.md b/samples/client/petstore/python/docs/Name.md index 3be719cdbfbac0318f07e0363452e946bb86f2af..6e58fae6d0bb1aacb5ad9a5985c61522d0fa27aa 100644 --- a/samples/client/petstore/python/docs/Name.md +++ b/samples/client/petstore/python/docs/Name.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **snake_case** | **int** | | [optional] [readonly] **_property** | **str** | | [optional] **_123_number** | **int** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/NumberOnly.md b/samples/client/petstore/python/docs/NumberOnly.md index 37195c5d89943f572c28f8e2637650449b2c903e..172e86163a44b8f85b2870242f0cf68234249299 100644 --- a/samples/client/petstore/python/docs/NumberOnly.md +++ b/samples/client/petstore/python/docs/NumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_number** | **float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/NumberWithValidations.md b/samples/client/petstore/python/docs/NumberWithValidations.md index 119e0f67823949d72a52065670f19ba70441f014..cc6f77c152c62255008d08c1a947112e8208a2c4 100644 --- a/samples/client/petstore/python/docs/NumberWithValidations.md +++ b/samples/client/petstore/python/docs/NumberWithValidations.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **float** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python/docs/ObjectModelWithRefProps.md index 5ff4e52033d6cadb1c9d07f446d443108c7d5b0d..a0d15f4bbd15d5fb4ad70dec875d792f81867c67 100644 --- a/samples/client/petstore/python/docs/ObjectModelWithRefProps.md +++ b/samples/client/petstore/python/docs/ObjectModelWithRefProps.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Order.md b/samples/client/petstore/python/docs/Order.md index d29e1a381de899db143d90ef4d2f7802df76830b..0423082932d5de2a3dd2ce76ec7f38be44bdbc63 100644 --- a/samples/client/petstore/python/docs/Order.md +++ b/samples/client/petstore/python/docs/Order.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **ship_date** | **datetime** | | [optional] **status** | **str** | Order Status | [optional] **complete** | **bool** | | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Parent.md b/samples/client/petstore/python/docs/Parent.md index 9d3f02d68b3120e43ad4c239a7c53e6643fb0d6f..9db770844ee1688fd25b192c967aa9d29a6b0404 100644 --- a/samples/client/petstore/python/docs/Parent.md +++ b/samples/client/petstore/python/docs/Parent.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **radio_waves** | **bool** | | [optional] **tele_vision** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ParentAllOf.md b/samples/client/petstore/python/docs/ParentAllOf.md index 569a5e4af14f72d72818bbecc486b94d801502bc..84ac2c066eed5bd4ce059c1795b584addc7c93d7 100644 --- a/samples/client/petstore/python/docs/ParentAllOf.md +++ b/samples/client/petstore/python/docs/ParentAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tele_vision** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ParentPet.md b/samples/client/petstore/python/docs/ParentPet.md index 09e409c8fcf10eef3f5a64d358aae0f357ca7f87..111ada88b3d1f209aea5942d3ee1d146c3878599 100644 --- a/samples/client/petstore/python/docs/ParentPet.md +++ b/samples/client/petstore/python/docs/ParentPet.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Pet.md b/samples/client/petstore/python/docs/Pet.md index 6e78495272e45b9932c5050f66d4014f2c2a8177..e0b129784564b7cc17f985497b5a98fc6715c4f1 100644 --- a/samples/client/petstore/python/docs/Pet.md +++ b/samples/client/petstore/python/docs/Pet.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **category** | [**Category**](Category.md) | | [optional] **tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Player.md b/samples/client/petstore/python/docs/Player.md index 2014198aa1bd183c7676b81fe48a7340a36efa7d..97441ae316bba572dc51f45431e02ddae3e08b67 100644 --- a/samples/client/petstore/python/docs/Player.md +++ b/samples/client/petstore/python/docs/Player.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | **enemy_player** | [**Player**](Player.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/ReadOnlyFirst.md b/samples/client/petstore/python/docs/ReadOnlyFirst.md index 53b4c61d844572c4c42ddc6d0a8595a23547f29f..ba39ec3d04e488e5b3ad513e66f568dc068982ed 100644 --- a/samples/client/petstore/python/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/python/docs/ReadOnlyFirst.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **str** | | [optional] [readonly] **baz** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/SpecialModelName.md b/samples/client/petstore/python/docs/SpecialModelName.md index 268e1134192d09305eab3e5fc28ba257c15341c2..4a1c86ff4de0b2afbd3e14cfcdf876d60713e7f8 100644 --- a/samples/client/petstore/python/docs/SpecialModelName.md +++ b/samples/client/petstore/python/docs/SpecialModelName.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **special_property_name** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/StringEnum.md b/samples/client/petstore/python/docs/StringEnum.md index bb195ec0e453ac02d1b0cf15326ad975d10814e2..1ac6df2fb797961d8c63befc8556486f527f262b 100644 --- a/samples/client/petstore/python/docs/StringEnum.md +++ b/samples/client/petstore/python/docs/StringEnum.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | | must be one of ["placed", "approved", "delivered", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Tag.md b/samples/client/petstore/python/docs/Tag.md index b9fe1e0944c484a5b31468ca6fe114b9b678cfc8..bfe06d1c5bfec96ae354da95a12a75edd09bae29 100644 --- a/samples/client/petstore/python/docs/Tag.md +++ b/samples/client/petstore/python/docs/Tag.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **name** | **str** | | [optional] **full_name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/TypeHolderDefault.md b/samples/client/petstore/python/docs/TypeHolderDefault.md index 904915aec01057c4d2157625c36a4ade0ba52051..f15c61cc4618231b8cde8727c636da6c72843eb0 100644 --- a/samples/client/petstore/python/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python/docs/TypeHolderDefault.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **bool_item** | **bool** | | defaults to True **date_item** | **date** | | [optional] **datetime_item** | **datetime** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/TypeHolderExample.md b/samples/client/petstore/python/docs/TypeHolderExample.md index d2954c64dcef1dc62911856e9728b036d19a20ee..d707ca3af203f57baffaf71b5633ab9a3bbcd842 100644 --- a/samples/client/petstore/python/docs/TypeHolderExample.md +++ b/samples/client/petstore/python/docs/TypeHolderExample.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **string_item** | **str** | | defaults to "what" **number_item** | **float** | | defaults to 1.234 **integer_item** | **int** | | defaults to -2 +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/User.md b/samples/client/petstore/python/docs/User.md index b0079f591b6e99f0a61c5ee2a464e9d6b4b2cca2..8e677b63cca6a9b95a13416326e232d3ee9f9983 100644 --- a/samples/client/petstore/python/docs/User.md +++ b/samples/client/petstore/python/docs/User.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **password** | **str** | | [optional] **phone** | **str** | | [optional] **user_status** | **int** | User Status | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/XmlItem.md b/samples/client/petstore/python/docs/XmlItem.md index ea3d7f92804b7370dca179060dccc2e5221c6e06..9852234a736786d1d700e9708671853eaf47549b 100644 --- a/samples/client/petstore/python/docs/XmlItem.md +++ b/samples/client/petstore/python/docs/XmlItem.md @@ -33,6 +33,7 @@ Name | Type | Description | Notes **prefix_ns_boolean** | **bool** | | [optional] **prefix_ns_array** | **[int]** | | [optional] **prefix_ns_wrapped_array** | **[int]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py index 4531d8f2d86218409e7b9de450a67b9ef97809de..7239795cf4afad75010e3d1267e54e11cad30505 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py @@ -63,7 +63,7 @@ class AdditionalPropertiesAnyType(ModelNormal): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python/petstore_api/model/additional_properties_array.py index 4a35500c63f356c8442cdd7f17cdfcb727cefa19..7d9403758a0da6e89b22c98e66c8f556fd1d2e84 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_array.py @@ -63,7 +63,7 @@ class AdditionalPropertiesArray(ModelNormal): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 + return ([bool, date, datetime, dict, float, int, list, str, none_type],) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/additional_properties_class.py index 743f3be54d441ba2727988c648544276e2701eca..39719e00dcfabb2771b9854ed00281af713d9b12 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_class.py @@ -57,7 +57,13 @@ class AdditionalPropertiesClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -77,12 +83,12 @@ class AdditionalPropertiesClass(ModelNormal): 'map_integer': ({str: (int,)},), # noqa: E501 'map_boolean': ({str: (bool,)},), # noqa: E501 'map_array_integer': ({str: ([int],)},), # noqa: E501 - 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str],)},), # noqa: E501 + 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)},), # noqa: E501 'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)},), # noqa: E501 - 'anytype_1': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 - 'anytype_2': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 - 'anytype_3': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 + 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)},), # noqa: E501 + 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'anytype_2': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'anytype_3': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 } @cached_property @@ -155,12 +161,12 @@ class AdditionalPropertiesClass(ModelNormal): map_integer ({str: (int,)}): [optional] # noqa: E501 map_boolean ({str: (bool,)}): [optional] # noqa: E501 map_array_integer ({str: ([int],)}): [optional] # noqa: E501 - map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str],)}): [optional] # noqa: E501 + map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 - anytype_2 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 - anytype_3 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 + map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 + anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 + anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python/petstore_api/model/additional_properties_object.py index 40e80e16044dfc7df6988823c11f34568d59d05d..000653f13a73594192097af2689a8acfc1714086 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_object.py @@ -63,7 +63,7 @@ class AdditionalPropertiesObject(ModelNormal): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 + return ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/animal.py b/samples/client/petstore/python/petstore_api/model/animal.py index a3d48b6ea97538be659a8e85c4af51af9f6cca07..c53b1e1ad289b72ac12668779a1aa493f78b57b5 100644 --- a/samples/client/petstore/python/petstore_api/model/animal.py +++ b/samples/client/petstore/python/petstore_api/model/animal.py @@ -63,7 +63,14 @@ class Animal(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/animal_farm.py b/samples/client/petstore/python/petstore_api/model/animal_farm.py index 838b18a1297081865e6fb98fed3495154603f168..fb58224ebd4c33587e278fb69c816cc972fc1196 100644 --- a/samples/client/petstore/python/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/model/animal_farm.py @@ -57,7 +57,14 @@ class AnimalFarm(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/api_response.py b/samples/client/petstore/python/petstore_api/model/api_response.py index 01e2175b8004e1e12e26f4e37b0ed08a44384675..53adb5aba12fa832cafb47a2e2a18819cb572737 100644 --- a/samples/client/petstore/python/petstore_api/model/api_response.py +++ b/samples/client/petstore/python/petstore_api/model/api_response.py @@ -57,7 +57,13 @@ class ApiResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py index 008b74dd42a3dba68a613c14fc18796163305889..8b6a2c42d0ede2e9425e94fb39492444bb29e6c0 100644 --- a/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py @@ -57,7 +57,13 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_number_only.py index f2e080bc258ecef70e7f4f4345c1691107b752a1..7b754dc283e6ffd250119826a0ad4b6c6ffe862b 100644 --- a/samples/client/petstore/python/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/model/array_of_number_only.py @@ -57,7 +57,13 @@ class ArrayOfNumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/array_test.py b/samples/client/petstore/python/petstore_api/model/array_test.py index ac42b07b93c9a525df0b5fc14ba55c32aebc324f..9691a1e603740fbc6615a1472f5140f2bdfcb793 100644 --- a/samples/client/petstore/python/petstore_api/model/array_test.py +++ b/samples/client/petstore/python/petstore_api/model/array_test.py @@ -61,7 +61,14 @@ class ArrayTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/capitalization.py b/samples/client/petstore/python/petstore_api/model/capitalization.py index 710c17e51a56e9c0e2eef5475cadca09d434a62a..6d939535ceefb58b016dc16bd628d95813d37c55 100644 --- a/samples/client/petstore/python/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python/petstore_api/model/capitalization.py @@ -57,7 +57,13 @@ class Capitalization(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/cat.py b/samples/client/petstore/python/petstore_api/model/cat.py index 8b5c46413b99811182d911e28fa91a16d7dc1cd3..eeea79359fc9846f59bf06a90f73da7d6a0e7073 100644 --- a/samples/client/petstore/python/petstore_api/model/cat.py +++ b/samples/client/petstore/python/petstore_api/model/cat.py @@ -63,7 +63,14 @@ class Cat(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -111,13 +118,11 @@ class Cat(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Cat - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -182,26 +187,18 @@ class Cat(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/client/petstore/python/petstore_api/model/cat_all_of.py index 50b046510dfaa37582c93936ac3c573e9ea69bf0..7efba680b4d89f15b223a9935016c19ed18ceef3 100644 --- a/samples/client/petstore/python/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/cat_all_of.py @@ -57,7 +57,13 @@ class CatAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/category.py b/samples/client/petstore/python/petstore_api/model/category.py index ed167471d35664c90ae5f591c851aa2a6c24bc85..4936b4f0e44353585296685e31a7aeb9398a47c0 100644 --- a/samples/client/petstore/python/petstore_api/model/category.py +++ b/samples/client/petstore/python/petstore_api/model/category.py @@ -57,7 +57,13 @@ class Category(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/child.py b/samples/client/petstore/python/petstore_api/model/child.py index c8f0a70a19312e05ce757e60bd63e610aa206adc..8fad3bf107bd296e427d7756d2e7d82b56335277 100644 --- a/samples/client/petstore/python/petstore_api/model/child.py +++ b/samples/client/petstore/python/petstore_api/model/child.py @@ -63,7 +63,14 @@ class Child(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -177,25 +184,18 @@ class Child(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/child_all_of.py b/samples/client/petstore/python/petstore_api/model/child_all_of.py index 2339e520bd6546b924ab92dadbc7b6697669d889..9db852ec725bfb3336ee662b4fa70ee96783cc99 100644 --- a/samples/client/petstore/python/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_all_of.py @@ -57,7 +57,13 @@ class ChildAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/child_cat.py b/samples/client/petstore/python/petstore_api/model/child_cat.py index a7d52b48e8accd4d5d5959133993fe47e683faba..d054cb7a97a012c4f583a8b0afc0723fa5180e36 100644 --- a/samples/client/petstore/python/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python/petstore_api/model/child_cat.py @@ -63,7 +63,14 @@ class ChildCat(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -109,13 +116,11 @@ class ChildCat(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ChildCat - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -179,26 +184,18 @@ class ChildCat(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py index f0f1a1ae6bd46c871864ab289ab349193c76b621..3d732d085fba8bd36b58b5eb76c0ab527e951f30 100644 --- a/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py @@ -57,7 +57,13 @@ class ChildCatAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/child_dog.py b/samples/client/petstore/python/petstore_api/model/child_dog.py index 2bc0882ac2a9ad1b3990b785ab691294ddee57d0..6244359fea2bb848be40ab52a27b97ce7c51c286 100644 --- a/samples/client/petstore/python/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python/petstore_api/model/child_dog.py @@ -63,7 +63,14 @@ class ChildDog(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -109,13 +116,11 @@ class ChildDog(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ChildDog - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -179,26 +184,18 @@ class ChildDog(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py index d460b68b3d3adcf9fcd6d7f60898fa6c33324ef3..d3a0d89c4da6d3f087dadc3111c687d4bf82f524 100644 --- a/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py @@ -57,7 +57,13 @@ class ChildDogAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard.py b/samples/client/petstore/python/petstore_api/model/child_lizard.py index 6142b9c751fe15ff39c42d0d1741ed5f89324259..b56925a0c92ba39c67f9628bbfe141e757d6cf82 100644 --- a/samples/client/petstore/python/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python/petstore_api/model/child_lizard.py @@ -63,7 +63,14 @@ class ChildLizard(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -109,13 +116,11 @@ class ChildLizard(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ChildLizard - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -179,26 +184,18 @@ class ChildLizard(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py index 669b9338d796cb18e3f424a28f585da28bbf41b8..1c8f29548b5722c34848afd4844b26f7654a1455 100644 --- a/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py @@ -57,7 +57,13 @@ class ChildLizardAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/class_model.py b/samples/client/petstore/python/petstore_api/model/class_model.py index 18c16f89f908c05047e2b217643a690890df041c..9e65a93736504ee985041a57bd3fd1cf335e92dd 100644 --- a/samples/client/petstore/python/petstore_api/model/class_model.py +++ b/samples/client/petstore/python/petstore_api/model/class_model.py @@ -57,7 +57,13 @@ class ClassModel(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/client.py b/samples/client/petstore/python/petstore_api/model/client.py index da615c54773113cf651c11f07635e2edb4b0c5d7..6218de1e19e481d92bb228fd4c6015376d1ead74 100644 --- a/samples/client/petstore/python/petstore_api/model/client.py +++ b/samples/client/petstore/python/petstore_api/model/client.py @@ -57,7 +57,13 @@ class Client(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/dog.py b/samples/client/petstore/python/petstore_api/model/dog.py index e9c201c983bbd7b20997c8aaaa98bd27cb2b269f..3452f0d040a070a80b3cd6b42e160fa32be049e2 100644 --- a/samples/client/petstore/python/petstore_api/model/dog.py +++ b/samples/client/petstore/python/petstore_api/model/dog.py @@ -63,7 +63,14 @@ class Dog(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -111,13 +118,11 @@ class Dog(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Dog - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -182,26 +187,18 @@ class Dog(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/client/petstore/python/petstore_api/model/dog_all_of.py index b7b2e7db66d9a119ab7ce5523d7ea99f8a10cf2a..962903d3a381919ae8733a12ac8993c85e52cabb 100644 --- a/samples/client/petstore/python/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/dog_all_of.py @@ -57,7 +57,13 @@ class DogAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/client/petstore/python/petstore_api/model/enum_arrays.py index 43ebac57de38367e7566dd830b193ed380c26b47..db56838d7e495fcffa800060fad9e1a72b20e052 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/model/enum_arrays.py @@ -65,7 +65,13 @@ class EnumArrays(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/enum_class.py b/samples/client/petstore/python/petstore_api/model/enum_class.py index 14188ca31d2839d23e1eafae39a0a900da72ffb9..63be703c38e9f732b635e400ac797d134fd4f6d7 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python/petstore_api/model/enum_class.py @@ -58,7 +58,13 @@ class EnumClass(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/enum_test.py b/samples/client/petstore/python/petstore_api/model/enum_test.py index 79ba0f6a747caf6f711de769162cab3efdaa8c3a..ee14c70b46f296bc32b97e11ee0752774b58b328 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python/petstore_api/model/enum_test.py @@ -79,7 +79,14 @@ class EnumTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/file.py b/samples/client/petstore/python/petstore_api/model/file.py index a38cccacc6abba832392b9c245077173f9878f9b..137d002632429d57c3ae77539d600b589725fcb5 100644 --- a/samples/client/petstore/python/petstore_api/model/file.py +++ b/samples/client/petstore/python/petstore_api/model/file.py @@ -57,7 +57,13 @@ class File(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py index b8c519ed9c7c1f9347c45de3e0f48eaff3cb25e4..3722125ae4859a5862bcf256c50f5526caa59d33 100644 --- a/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py @@ -61,7 +61,14 @@ class FileSchemaTestClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/format_test.py b/samples/client/petstore/python/petstore_api/model/format_test.py index 494ce2646da094a131e803bc32f55625ddbccc3c..7b415af7ad2c6305e9815fa31c41e14d97b1abd5 100644 --- a/samples/client/petstore/python/petstore_api/model/format_test.py +++ b/samples/client/petstore/python/petstore_api/model/format_test.py @@ -92,7 +92,13 @@ class FormatTest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/grandparent.py b/samples/client/petstore/python/petstore_api/model/grandparent.py index a52744cc3e24be29c9182df480b065346a302c72..728b1e1d129756c17d6df66411ff69880b684454 100644 --- a/samples/client/petstore/python/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python/petstore_api/model/grandparent.py @@ -57,7 +57,13 @@ class Grandparent(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python/petstore_api/model/grandparent_animal.py index 48d3f6d9f0b3ea174ba7ba0bc7b5592cdcdf683c..089f5a4a07c6fbb78fc573a420dfd808099ab2b3 100644 --- a/samples/client/petstore/python/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python/petstore_api/model/grandparent_animal.py @@ -67,7 +67,14 @@ class GrandparentAnimal(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python/petstore_api/model/has_only_read_only.py index c94781ae2c462240fc093c18cadef278a4ee857b..4ea0bb08721789f91c4986f20d8931d6068e5d91 100644 --- a/samples/client/petstore/python/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/model/has_only_read_only.py @@ -57,7 +57,13 @@ class HasOnlyReadOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/list.py b/samples/client/petstore/python/petstore_api/model/list.py index 09c762d6a79421da4b99e9981e7614b0746c65ec..11b46f10b565fffacb8d3a5626aae8a7430e0b7f 100644 --- a/samples/client/petstore/python/petstore_api/model/list.py +++ b/samples/client/petstore/python/petstore_api/model/list.py @@ -57,7 +57,13 @@ class List(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/map_test.py b/samples/client/petstore/python/petstore_api/model/map_test.py index 169fb9d88ee0d30261cee78c2747dc4679adb648..a5418b39e734fa3c4c318a4b955a4f4a0c81d68c 100644 --- a/samples/client/petstore/python/petstore_api/model/map_test.py +++ b/samples/client/petstore/python/petstore_api/model/map_test.py @@ -65,7 +65,14 @@ class MapTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py index 01df80d9d62b3a734d65f1412df9c810e497cb22..67b3f79d9e5f36b1efa817fbf76c6aa4bf99949c 100644 --- a/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -61,7 +61,14 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/model200_response.py b/samples/client/petstore/python/petstore_api/model/model200_response.py index 46b155b65239225575decfb2ba17d2b9ae43b68c..056f4c56ad35d1889d4f506158624f8d152f300c 100644 --- a/samples/client/petstore/python/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python/petstore_api/model/model200_response.py @@ -57,7 +57,13 @@ class Model200Response(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/model_return.py b/samples/client/petstore/python/petstore_api/model/model_return.py index 377b3507a8b3e3ecbf6c3a784d86b4f925c5a7e9..5f34582cdb4a779c12defa27672022d7194e65e2 100644 --- a/samples/client/petstore/python/petstore_api/model/model_return.py +++ b/samples/client/petstore/python/petstore_api/model/model_return.py @@ -57,7 +57,13 @@ class ModelReturn(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/name.py b/samples/client/petstore/python/petstore_api/model/name.py index 1432e185ad6b33a2ec2707e74423f168b3ec8f10..06b387ce9bfe6839d952e5c48bfdc1c8d719d5ec 100644 --- a/samples/client/petstore/python/petstore_api/model/name.py +++ b/samples/client/petstore/python/petstore_api/model/name.py @@ -57,7 +57,13 @@ class Name(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/number_only.py b/samples/client/petstore/python/petstore_api/model/number_only.py index d4892dbede5b53f15e2a614ace9ebf3155cb1355..cb2c9e2ad52685625196092f264176155ced73ee 100644 --- a/samples/client/petstore/python/petstore_api/model/number_only.py +++ b/samples/client/petstore/python/petstore_api/model/number_only.py @@ -57,7 +57,13 @@ class NumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/client/petstore/python/petstore_api/model/number_with_validations.py index 458a7945975144b44a566e831bda1736aeaf3f88..fb47d885bfd76cb3103d2be7ed525ac62f773e7e 100644 --- a/samples/client/petstore/python/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python/petstore_api/model/number_with_validations.py @@ -57,7 +57,13 @@ class NumberWithValidations(ModelSimple): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py index b1dc4bf82e2cb17fc154a70973bba2848ac20bb8..7256f67a8d6bc32b909b1b69fb73c63031afb5fb 100644 --- a/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py @@ -61,7 +61,14 @@ class ObjectModelWithRefProps(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/order.py b/samples/client/petstore/python/petstore_api/model/order.py index b42f066848abdeac9684274b463a6aab5d703dda..48207e4560eb990001d1daa2348e6c0b9ced72da 100644 --- a/samples/client/petstore/python/petstore_api/model/order.py +++ b/samples/client/petstore/python/petstore_api/model/order.py @@ -62,7 +62,13 @@ class Order(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/parent.py b/samples/client/petstore/python/petstore_api/model/parent.py index a5e5d878d8447a9fd1cf1318ba8415c19a6492bb..063d5051747d6c82646ce21caa5653494617c31e 100644 --- a/samples/client/petstore/python/petstore_api/model/parent.py +++ b/samples/client/petstore/python/petstore_api/model/parent.py @@ -63,7 +63,14 @@ class Parent(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -174,25 +181,18 @@ class Parent(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/parent_all_of.py b/samples/client/petstore/python/petstore_api/model/parent_all_of.py index 0d109f25a4c277f66fee4d202366f0ce32b0fca5..2f7b8a791d29a4e99327f0a46ed85e284859d331 100644 --- a/samples/client/petstore/python/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/parent_all_of.py @@ -57,7 +57,13 @@ class ParentAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/parent_pet.py b/samples/client/petstore/python/petstore_api/model/parent_pet.py index aac0ff12e86bdb56de3c94f22afbbc64447d0309..b012d1558a79c8f483374f18c092a17ab9efe7df 100644 --- a/samples/client/petstore/python/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python/petstore_api/model/parent_pet.py @@ -67,7 +67,14 @@ class ParentPet(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -115,13 +122,11 @@ class ParentPet(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ParentPet - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -184,26 +189,18 @@ class ParentPet(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python/petstore_api/model/pet.py b/samples/client/petstore/python/petstore_api/model/pet.py index e9f1e30a3196009737f3fcd5d85018ea1c755673..b0c8b08607d107e62412cc5cff6e4fed943c4b33 100644 --- a/samples/client/petstore/python/petstore_api/model/pet.py +++ b/samples/client/petstore/python/petstore_api/model/pet.py @@ -68,7 +68,14 @@ class Pet(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/player.py b/samples/client/petstore/python/petstore_api/model/player.py index 6e4485fb65003cb6e1f576bf7cab135404a214c5..2c51f9b57af72e2dc124c145ce90e0150a5ef03a 100644 --- a/samples/client/petstore/python/petstore_api/model/player.py +++ b/samples/client/petstore/python/petstore_api/model/player.py @@ -57,7 +57,13 @@ class Player(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/read_only_first.py b/samples/client/petstore/python/petstore_api/model/read_only_first.py index 5c68eab91ea391b3496a9a69b5db0800bbdaeff1..0302bf96a7e56c6cde4db736436ad1d349a554b8 100644 --- a/samples/client/petstore/python/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/model/read_only_first.py @@ -57,7 +57,13 @@ class ReadOnlyFirst(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/special_model_name.py b/samples/client/petstore/python/petstore_api/model/special_model_name.py index 823e77596636c81d969e568a0b36e6e56ddb56ba..cfaedbc7881506d18a5b616abc4992289f845237 100644 --- a/samples/client/petstore/python/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/model/special_model_name.py @@ -57,7 +57,13 @@ class SpecialModelName(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/string_enum.py b/samples/client/petstore/python/petstore_api/model/string_enum.py index 37dc04332cac7544e60b8464aaf3798c2b366011..4c92316cb7e0b39773ad63a49793d5d3f01cdedc 100644 --- a/samples/client/petstore/python/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python/petstore_api/model/string_enum.py @@ -58,7 +58,13 @@ class StringEnum(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/tag.py b/samples/client/petstore/python/petstore_api/model/tag.py index d3dcb78b7ea05c0727b989591010ecb82c39e23a..01c28233598b8d36b49caa4262baee9e79259603 100644 --- a/samples/client/petstore/python/petstore_api/model/tag.py +++ b/samples/client/petstore/python/petstore_api/model/tag.py @@ -57,7 +57,13 @@ class Tag(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_default.py b/samples/client/petstore/python/petstore_api/model/type_holder_default.py index 324b131f3a2d6fc2587d75d28e2c377659f1c323..04a96f7e90600824ef8ce595ff74aab867123b11 100644 --- a/samples/client/petstore/python/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python/petstore_api/model/type_holder_default.py @@ -57,7 +57,13 @@ class TypeHolderDefault(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_example.py b/samples/client/petstore/python/petstore_api/model/type_holder_example.py index 30bbba178f4f8e8b6e37e4d3e86029702c32c288..f6e5f44c389b8879aacc4f52f756e4b5ecf7f190 100644 --- a/samples/client/petstore/python/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python/petstore_api/model/type_holder_example.py @@ -66,7 +66,13 @@ class TypeHolderExample(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/user.py b/samples/client/petstore/python/petstore_api/model/user.py index 9a3cd08141142907060876b5f06badf5fdde79fd..64bd69849330c58bf13039c576e48e7f0205878c 100644 --- a/samples/client/petstore/python/petstore_api/model/user.py +++ b/samples/client/petstore/python/petstore_api/model/user.py @@ -57,7 +57,13 @@ class User(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model/xml_item.py b/samples/client/petstore/python/petstore_api/model/xml_item.py index 8401b3f40076edeba9c02a2e8bafcb74c5287344..ba096779721be0d6221f325f182a216398dfd9a7 100644 --- a/samples/client/petstore/python/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python/petstore_api/model/xml_item.py @@ -57,7 +57,13 @@ class XmlItem(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/client/petstore/python/petstore_api/model_utils.py b/samples/client/petstore/python/petstore_api/model_utils.py index f73278f35cc7eb414b5cff724f44716c77daceda..3a555f0a88c43615eb88534c30370f73d7f4489c 100644 --- a/samples/client/petstore/python/petstore_api/model_utils.py +++ b/samples/client/petstore/python/petstore_api/model_utils.py @@ -434,27 +434,43 @@ class ModelComposed(OpenApiModel): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -464,13 +480,12 @@ class ModelComposed(OpenApiModel): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1584,8 +1599,13 @@ def get_allof_instances(self, model_args, constant_args): self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1593,20 +1613,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1666,31 +1674,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1747,24 +1733,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1777,47 +1747,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1861,36 +1818,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/samples/client/petstore/python/pom.xml b/samples/client/petstore/python/pom.xml index 9dc399cc8089328d3b9ca15533a4361fd5f7310b..f6178c5c09c872358283bdb8e9146d743a50a685 100644 --- a/samples/client/petstore/python/pom.xml +++ b/samples/client/petstore/python/pom.xml @@ -1,10 +1,10 @@ <project> <modelVersion>4.0.0</modelVersion> <groupId>org.openapitools</groupId> - <artifactId>PythonExperimentalPetstoreClientTests</artifactId> + <artifactId>PythonV2PetstoreClientTestsWithComposition</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> - <name>Python Experimental OpenAPI Petstore Client</name> + <name>Python OpenAPI Petstore Client</name> <build> <plugins> <plugin> diff --git a/samples/client/petstore/python/test/test_child.py b/samples/client/petstore/python/test/test_child.py index 3b49febd953252253eb914df63b854a1145fb246..88e6b9ed4a8e88522484f563672d73acad59fd3f 100644 --- a/samples/client/petstore/python/test/test_child.py +++ b/samples/client/petstore/python/test/test_child.py @@ -73,14 +73,6 @@ class TestChild(unittest.TestCase): } ) - # setting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(petstore_api.ApiAttributeError): - child['invalid_variable'] = 'some value' - # with setattr - with self.assertRaises(petstore_api.ApiAttributeError): - setattr(child, 'invalid_variable', 'some value') - # with hasattr self.assertFalse(hasattr(child, 'invalid_variable')) @@ -123,17 +115,26 @@ class TestChild(unittest.TestCase): self.assertEqual( child._var_name_to_model_instances, { - 'radio_waves': [child, parent_instance], - 'tele_vision': [child, parent_instance], - 'inter_net': [child, child_allof_instance] + 'radio_waves': [child, child_allof_instance, parent_instance], + 'tele_vision': [child, child_allof_instance, parent_instance], + 'inter_net': [child, child_allof_instance, parent_instance] } ) # model._additional_properties_model_instances stores a list of # models which have the property additional_properties_type != None self.assertEqual( - child._additional_properties_model_instances, [] + child._additional_properties_model_instances, [child] ) + # setting a value that doesn't exist works + # with a key + child['invalid_variable'] = 'a' + assert child.invalid_variable == 'a' + # with setattr + setattr(child, 'invalid_variable', 'b') + assert child.invalid_variable == 'b' + + # if we modify one of the properties owned by multiple # model_instances we get an exception when we try to access that # property because the retrieved values are not all the same @@ -141,13 +142,13 @@ class TestChild(unittest.TestCase): with self.assertRaises(petstore_api.ApiValueError): inter_net = child.inter_net - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - child = Child( - radio_waves=radio_waves, - tele_vision=tele_vision, - inter_net=inter_net, - unknown_property='some value') + # including extra parameters works + child = Child( + radio_waves=radio_waves, + tele_vision=tele_vision, + inter_net=inter_net, + unknown_property='some value') + assert child.unknown_property == 'some value' if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py index 0b95c0a4c83acb11b74688912d9af083cb4d535d..0352d794c928f78b76b628d5ec40b635b75a59a1 100644 --- a/samples/client/petstore/python/test/test_dog.py +++ b/samples/client/petstore/python/test/test_dog.py @@ -73,23 +73,15 @@ class TestDog(unittest.TestCase): } ) - # setting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - dog['invalid_variable'] = 'some value' - # with setattr - with self.assertRaises(AttributeError): - setattr(dog, 'invalid_variable', 'some value') - # getting a value that doesn't exist raises an exception # with a key with self.assertRaises(AttributeError): - invalid_variable = dog['invalid_variable'] + invalid_variable = dog['not_here_a'] # with getattr - self.assertEqual(getattr(dog, 'invalid_variable', 'some value'), 'some value') + self.assertEqual(getattr(dog, 'not_here_a', 'some value'), 'some value') with self.assertRaises(AttributeError): - invalid_variable = getattr(dog, 'invalid_variable') + invalid_variable = getattr(dog, 'not_here_a') # make sure that the ModelComposed class properties are correct # model.composed_schemas() stores the anyOf/allOf/oneOf info @@ -120,17 +112,25 @@ class TestDog(unittest.TestCase): self.assertEqual( dog._var_name_to_model_instances, { - 'breed': [dog, dog_allof_instance], - 'class_name': [dog, animal_instance], - 'color': [dog, animal_instance] + 'breed': [dog, animal_instance, dog_allof_instance], + 'class_name': [dog, animal_instance, dog_allof_instance], + 'color': [dog, animal_instance, dog_allof_instance] } ) # model._additional_properties_model_instances stores a list of # models which have the property additional_properties_type != None self.assertEqual( - dog._additional_properties_model_instances, [] + dog._additional_properties_model_instances, [dog] ) + # setting a value that doesn't exist works + dog['invalid_variable'] = 'a' + assert dog.invalid_variable == 'a' + + # with setattr + setattr(dog, 'invalid_variable', 'b') + assert dog.invalid_variable == 'b' + # if we modify one of the properties owned by multiple # model_instances we get an exception when we try to access that # property because the retrieved values are not all the same @@ -138,14 +138,14 @@ class TestDog(unittest.TestCase): with self.assertRaises(petstore_api.ApiValueError): breed = dog.breed - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - dog = Dog( - class_name=class_name, - color=color, - breed=breed, - unknown_property='some value' - ) + # including extra parameters works + dog = Dog( + class_name=class_name, + color=color, + breed=breed, + unknown_property='some value' + ) + assert dog.unknown_property == 'some value' if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitignore b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..43995bd42fa23bbc4c3a59d5fb9da99042fcf139 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..9e84f517616359dc61dce211803da0653907e67c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml @@ -0,0 +1,24 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.tests: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=petstore_api + +test-3.6: + extends: .tests + image: python:3.6-alpine +test-3.7: + extends: .tests + image: python:3.7-alpine +test-3.8: + extends: .tests + image: python:3.8-alpine +test-3.9: + extends: .tests + image: python:3.9-alpine diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore new file mode 100644 index 0000000000000000000000000000000000000000..7484ee590a3894506cf063799b885428f95a71be --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES new file mode 100644 index 0000000000000000000000000000000000000000..a5adeaaddc688602711747ca2d0da49b07be5798 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES @@ -0,0 +1,159 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnimalFarm.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/Child.md +docs/ChildAllOf.md +docs/ChildCat.md +docs/ChildCatAllOf.md +docs/ChildDog.md +docs/ChildDogAllOf.md +docs/ChildLizard.md +docs/ChildLizardAllOf.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/Grandparent.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/NumberWithValidations.md +docs/ObjectModelWithRefProps.md +docs/Order.md +docs/Parent.md +docs/ParentAllOf.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Player.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/StringBooleanMap.md +docs/StringEnum.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/apis/__init__.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/model/__init__.py +petstore_api/model/additional_properties_any_type.py +petstore_api/model/additional_properties_array.py +petstore_api/model/additional_properties_boolean.py +petstore_api/model/additional_properties_class.py +petstore_api/model/additional_properties_integer.py +petstore_api/model/additional_properties_number.py +petstore_api/model/additional_properties_object.py +petstore_api/model/additional_properties_string.py +petstore_api/model/animal.py +petstore_api/model/animal_farm.py +petstore_api/model/api_response.py +petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_number_only.py +petstore_api/model/array_test.py +petstore_api/model/capitalization.py +petstore_api/model/cat.py +petstore_api/model/cat_all_of.py +petstore_api/model/category.py +petstore_api/model/child.py +petstore_api/model/child_all_of.py +petstore_api/model/child_cat.py +petstore_api/model/child_cat_all_of.py +petstore_api/model/child_dog.py +petstore_api/model/child_dog_all_of.py +petstore_api/model/child_lizard.py +petstore_api/model/child_lizard_all_of.py +petstore_api/model/class_model.py +petstore_api/model/client.py +petstore_api/model/dog.py +petstore_api/model/dog_all_of.py +petstore_api/model/enum_arrays.py +petstore_api/model/enum_class.py +petstore_api/model/enum_test.py +petstore_api/model/file.py +petstore_api/model/file_schema_test_class.py +petstore_api/model/format_test.py +petstore_api/model/grandparent.py +petstore_api/model/grandparent_animal.py +petstore_api/model/has_only_read_only.py +petstore_api/model/list.py +petstore_api/model/map_test.py +petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/model200_response.py +petstore_api/model/model_return.py +petstore_api/model/name.py +petstore_api/model/number_only.py +petstore_api/model/number_with_validations.py +petstore_api/model/object_model_with_ref_props.py +petstore_api/model/order.py +petstore_api/model/parent.py +petstore_api/model/parent_all_of.py +petstore_api/model/parent_pet.py +petstore_api/model/pet.py +petstore_api/model/player.py +petstore_api/model/read_only_first.py +petstore_api/model/special_model_name.py +petstore_api/model/string_boolean_map.py +petstore_api/model/string_enum.py +petstore_api/model/tag.py +petstore_api/model/type_holder_default.py +petstore_api/model/type_holder_example.py +petstore_api/model/user.py +petstore_api/model/xml_item.py +petstore_api/model_utils.py +petstore_api/models/__init__.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..6555596f931149bc73ff7b8c2d0ab3985c120e26 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.travis.yml b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..1fcc4b1559646a458dc55a923eed0e220ceddb11 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.6" + - "3.7" + - "3.8" + - "3.9" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/Makefile b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..a6bbba4a434fd6e4c87c6742f97552fdbfffa003 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/Makefile @@ -0,0 +1,18 @@ + #!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python.sh diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5f53c0f642352fa5aba8ec0e540fd13e69897e1d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md @@ -0,0 +1,247 @@ +# petstore-api +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python >= 3.6 + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import time +import petstore_api +from pprint import pprint +from petstore_api.api import another_fake_api +from petstore_api.model.client import Client +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = another_fake_api.AnotherFakeApi(api_client) + body = Client( + client="client_example", + ) # Client | client model + + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | +*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | +*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [Child](docs/Child.md) + - [ChildAllOf](docs/ChildAllOf.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ChildDog](docs/ChildDog.md) + - [ChildDogAllOf](docs/ChildDogAllOf.md) + - [ChildLizard](docs/ChildLizard.md) + - [ChildLizardAllOf](docs/ChildLizardAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [Grandparent](docs/Grandparent.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [Order](docs/Order.md) + - [Parent](docs/Parent.md) + - [ParentAllOf](docs/ParentAllOf.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Player](docs/Player.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- `from petstore_api.api.default_api import DefaultApi` +- `from petstore_api.model.pet import Pet` + +Solution 2: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import petstore_api +from petstore_api.apis import * +from petstore_api.models import * +``` + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..ccdfca629494d473aa1a57657fb876bd86a2f986 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 0000000000000000000000000000000000000000..d31d12de08229ff54595fb8e40018dd07fe7a907 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesAnyType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md new file mode 100644 index 0000000000000000000000000000000000000000..40537cbf8384f3dbb4d98839eb62ed5bc12fecf8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesArray + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 0000000000000000000000000000000000000000..bf7b5be4c13df25dff9fdd273daf7a36062b20ad --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesBoolean + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md new file mode 100644 index 0000000000000000000000000000000000000000..fe54cef0539ffbcf1d27811600a5e1a0e6049899 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md @@ -0,0 +1,21 @@ +# AdditionalPropertiesClass + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_string** | **{str: (str,)}** | | [optional] +**map_number** | **{str: (float,)}** | | [optional] +**map_integer** | **{str: (int,)}** | | [optional] +**map_boolean** | **{str: (bool,)}** | | [optional] +**map_array_integer** | **{str: ([int],)}** | | [optional] +**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}** | | [optional] +**map_map_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}** | | [optional] +**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**anytype_2** | **bool, date, datetime, dict, float, int, list, str, none_type** | no type is set for this | [optional] +**anytype_3** | **bool, date, datetime, dict, float, int, list, str, none_type** | because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378 | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md new file mode 100644 index 0000000000000000000000000000000000000000..96345efd4cc893b14df0f244e91d376e87012bf3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesInteger + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md new file mode 100644 index 0000000000000000000000000000000000000000..9af52dc6dcfd6367e173961836ac6142c76ae8e5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesNumber + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **float** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md new file mode 100644 index 0000000000000000000000000000000000000000..dc64a0d91c2439da3bd3a24523306579d9212af7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesObject + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type,)}** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md new file mode 100644 index 0000000000000000000000000000000000000000..fe3993d02265bdacd83f90168023f09ded77cb32 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md @@ -0,0 +1,12 @@ +# AdditionalPropertiesString + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **str** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md new file mode 100644 index 0000000000000000000000000000000000000000..1d1c77c01abc4cb048828b44b4ececc8d677d565 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md @@ -0,0 +1,12 @@ +# Animal + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of "red" + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md new file mode 100644 index 0000000000000000000000000000000000000000..fc299cf27d342d3499915b0438134d7c16952cfb --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md @@ -0,0 +1,11 @@ +# AnimalFarm + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**[Animal]**](Animal.md) | | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md new file mode 100644 index 0000000000000000000000000000000000000000..470caed72cc589be5e0ba6c1a173c13fe122425b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md @@ -0,0 +1,76 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> Client call_123_test_special_tags(body) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +import time +import petstore_api +from petstore_api.api import another_fake_api +from petstore_api.model.client import Client +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = another_fake_api.AnotherFakeApi(api_client) + body = Client( + client="client_example", + ) # Client | client model + + # example passing only required values which don't have defaults set + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md new file mode 100644 index 0000000000000000000000000000000000000000..81a7d0d85227718256a4a53ca8bcbc2096d2f1c8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md @@ -0,0 +1,13 @@ +# ApiResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 0000000000000000000000000000000000000000..6ab77963788b2634f2b3b1af7455e14488b9a063 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,11 @@ +# ArrayOfArrayOfNumberOnly + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **[[float]]** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md new file mode 100644 index 0000000000000000000000000000000000000000..ebc65a54ba7ef0b656134ccb1aee1cd4b377638b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md @@ -0,0 +1,11 @@ +# ArrayOfNumberOnly + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **[float]** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md new file mode 100644 index 0000000000000000000000000000000000000000..4e1bda8fc3af5d206578dc1c8325b5ab63b86731 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md @@ -0,0 +1,13 @@ +# ArrayTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md new file mode 100644 index 0000000000000000000000000000000000000000..1ddeadeb3f463ba78caacd3c75a820ad59ff5fc2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md @@ -0,0 +1,16 @@ +# Capitalization + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md new file mode 100644 index 0000000000000000000000000000000000000000..e9ce235cd632f90499f0a65f82d882a153e4f98d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md @@ -0,0 +1,13 @@ +# Cat + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of "red" + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..0ff7809a99ac07c46854b47e3ebdd750dbc7ab8f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md @@ -0,0 +1,11 @@ +# CatAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Category.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Category.md new file mode 100644 index 0000000000000000000000000000000000000000..940f6a45e6418f84e5483d84264b461b4dc3306a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Category.md @@ -0,0 +1,12 @@ +# Category + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to "default-name" +**id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Child.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Child.md new file mode 100644 index 0000000000000000000000000000000000000000..eb4392445710896a5e05af0a442ca4b787011312 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Child.md @@ -0,0 +1,13 @@ +# Child + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**radio_waves** | **bool** | | [optional] +**tele_vision** | **bool** | | [optional] +**inter_net** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..f9ae99c7c15713d0c7e8d3e4d7e413fab09b6d47 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md @@ -0,0 +1,11 @@ +# ChildAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inter_net** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md new file mode 100644 index 0000000000000000000000000000000000000000..9e3a0fb4b51ac85db317617424a175ed2a2ae5ed --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md @@ -0,0 +1,12 @@ +# ChildCat + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | +**name** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..c5883b9a87c80c063d04bb4bf33345c6024b4a70 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# ChildCatAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md new file mode 100644 index 0000000000000000000000000000000000000000..9a6e5b372664b5851981e3289f225bc6fc266e00 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md @@ -0,0 +1,12 @@ +# ChildDog + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | +**bark** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..673050667cb3ab7f67164a908017033ad853be9f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md @@ -0,0 +1,11 @@ +# ChildDogAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bark** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md new file mode 100644 index 0000000000000000000000000000000000000000..e881ee0a1d1b0ecd5a500761ec78299ac3466e36 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md @@ -0,0 +1,12 @@ +# ChildLizard + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | +**loves_rocks** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..6e2b70c01505e59d38e7bd1590e3ed07a7e50560 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md @@ -0,0 +1,11 @@ +# ChildLizardAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loves_rocks** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md new file mode 100644 index 0000000000000000000000000000000000000000..48ed7cbf2ff0c35fd1e04db8a094eb2fdeddf1f9 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md @@ -0,0 +1,12 @@ +# ClassModel + +Model for testing model with \"_class\" property + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Client.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Client.md new file mode 100644 index 0000000000000000000000000000000000000000..c3986008d6c37dcb94e62691067f468b8b196e6f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Client.md @@ -0,0 +1,11 @@ +# Client + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md new file mode 100644 index 0000000000000000000000000000000000000000..7065c4c983d95919495d62719cd703ba21fc9dc4 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md @@ -0,0 +1,13 @@ +# Dog + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of "red" + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..6382bbd80671a878eec0d9ea040d6e9958c25ab6 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md @@ -0,0 +1,11 @@ +# DogAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md new file mode 100644 index 0000000000000000000000000000000000000000..9be5c645a8099d2df1275940b7c3ab4f4e8bb72c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md @@ -0,0 +1,12 @@ +# EnumArrays + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md new file mode 100644 index 0000000000000000000000000000000000000000..a1f9aae5819006fc6b7acd69d196f1e575c97311 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md @@ -0,0 +1,11 @@ +# EnumClass + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md new file mode 100644 index 0000000000000000000000000000000000000000..eb88422413904dc06649ea020ef169e98419ae40 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md @@ -0,0 +1,15 @@ +# EnumTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**string_enum** | [**StringEnum**](StringEnum.md) | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md new file mode 100644 index 0000000000000000000000000000000000000000..bfd6467215bac9419e106c89359f3107b4063084 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md @@ -0,0 +1,1205 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | +[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +[**string**](FakeApi.md#string) | **POST** /fake/refs/string | +[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data + + +# **array_model** +> AnimalFarm array_model() + + + +Test serialization of ArrayModel + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.animal_farm import AnimalFarm +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = AnimalFarm([ + Animal(), + ]) # AnimalFarm | Input model (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.array_model(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->array_model: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] + +### Return type + +[**AnimalFarm**](AnimalFarm.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output model | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **boolean** +> bool boolean() + + + +Test serialization of outer boolean types + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.boolean(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->boolean: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_xml_item** +> create_xml_item(xml_item) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.xml_item import XmlItem +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + xml_item = XmlItem( + attribute_string="string", + attribute_number=1.234, + attribute_integer=-2, + attribute_boolean=True, + wrapped_array=[ + 1, + ], + name_string="string", + name_number=1.234, + name_integer=-2, + name_boolean=True, + name_array=[ + 1, + ], + name_wrapped_array=[ + 1, + ], + prefix_string="string", + prefix_number=1.234, + prefix_integer=-2, + prefix_boolean=True, + prefix_array=[ + 1, + ], + prefix_wrapped_array=[ + 1, + ], + namespace_string="string", + namespace_number=1.234, + namespace_integer=-2, + namespace_boolean=True, + namespace_array=[ + 1, + ], + namespace_wrapped_array=[ + 1, + ], + prefix_ns_string="string", + prefix_ns_number=1.234, + prefix_ns_integer=-2, + prefix_ns_boolean=True, + prefix_ns_array=[ + 1, + ], + prefix_ns_wrapped_array=[ + 1, + ], + ) # XmlItem | XmlItem Body + + # example passing only required values which don't have defaults set + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **number_with_validations** +> NumberWithValidations number_with_validations() + + + +Test serialization of outer number types + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.number_with_validations import NumberWithValidations +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = NumberWithValidations(1E+1) # NumberWithValidations | Input number as post body (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.number_with_validations(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->number_with_validations: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] + +### Return type + +[**NumberWithValidations**](NumberWithValidations.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **object_model_with_ref_props** +> ObjectModelWithRefProps object_model_with_ref_props() + + + +Test serialization of object with $refed properties + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = ObjectModelWithRefProps( + my_number=NumberWithValidations(1E+1), + my_string="my_string_example", + my_boolean=True, + ) # ObjectModelWithRefProps | Input model (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.object_model_with_ref_props(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] + +### Return type + +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output model | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **string** +> str string() + + + +Test serialization of outer string types + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = "body_example" # str | Input string as post body (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.string(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **string_enum** +> StringEnum string_enum() + + + +Test serialization of outer enum + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.string_enum import StringEnum +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = StringEnum("placed") # StringEnum | Input enum (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.string_enum(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string_enum: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] + +### Return type + +[**StringEnum**](StringEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output enum | - | + +[[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) + +# **test_body_with_file_schema** +> test_body_with_file_schema(body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = FileSchemaTestClass( + file=File( + source_uri="source_uri_example", + ), + files=[ + File( + source_uri="source_uri_example", + ), + ], + ) # FileSchemaTestClass | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_file_schema(body) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + +# **test_body_with_query_params** +> test_body_with_query_params(query, body) + + + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + query = "query_example" # str | + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + ) # User | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_query_params(query, body) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **str**| | + **body** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + +# **test_client_model** +> Client test_client_model(body) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.client import Client +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + body = Client( + client="client_example", + ) # Client | client model + + # example passing only required values which don't have defaults set + try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **test_endpoint_enums_length_one** +> test_endpoint_enums_length_one() + + + +This route has required values with enums of 1 + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + try: + api_instance.test_endpoint_enums_length_one() + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query_integer** | **int**| | defaults to 3 + **query_string** | **str**| | defaults to "brillig" + **path_string** | **str**| | defaults to "hello" + **path_integer** | **int**| | defaults to 34 + **header_number** | **float**| | defaults to 1.234 + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + +Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ + +Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ + +### Example + +* Basic Authentication (http_basic_test): +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + number = 32.1 # float | None + double = 67.8 # float | None + pattern_without_delimiter = "Aj" # str | None + byte = 'YQ==' # str | None + integer = 10 # int | None (optional) + int32 = 20 # int | None (optional) + int64 = 1 # int | None (optional) + float = 3.14 # float | None (optional) + string = "A" # str | None (optional) + binary = open('/path/to/file', 'rb') # file_type | None (optional) + date = dateutil_parser('1970-01-01').date() # date | None (optional) + date_time = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | None (optional) + password = "password_example" # str | None (optional) + param_callback = "param_callback_example" # str | None (optional) + + # example passing only required values which don't have defaults set + try: + # Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file_type**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **test_enum_parameters** +> test_enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + enum_header_string_array = [ + "$", + ] # [str] | Header parameter enum test (string array) (optional) + enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" + enum_query_string_array = [ + "$", + ] # [str] | Query parameter enum test (string array) (optional) + enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" + enum_query_integer = 1 # int | Query parameter enum test (double) (optional) + enum_query_double = 1.1 # float | Query parameter enum test (double) (optional) + enum_form_string_array = "$" # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$" + enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" + + # example passing only required values which don't have defaults set + # and optional values + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" + **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$" + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[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) + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + required_string_group = 1 # int | Required String in group parameters + required_boolean_group = True # bool | Required Boolean in group parameters + required_int64_group = 1 # int | Required Integer in group parameters + string_group = 1 # int | String in group parameters (optional) + boolean_group = True # bool | Boolean in group parameters (optional) + int64_group = 1 # int | Integer in group parameters (optional) + + # example passing only required values which don't have defaults set + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + +[[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) + +# **test_inline_additional_properties** +> test_inline_additional_properties(param) + +test inline additionalProperties + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + param = { + "key": "key_example", + } # {str: (str,)} | request body + + # example passing only required values which don't have defaults set + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **{str: (str,)}**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + param = "param_example" # str | field1 + param2 = "param2_example" # str | field2 + + # example passing only required values which don't have defaults set + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md new file mode 100644 index 0000000000000000000000000000000000000000..3452fd6ddff47a9aa12e2b78a98a34ed4df66ab6 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md @@ -0,0 +1,87 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(body) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +import time +import petstore_api +from petstore_api.api import fake_classname_tags_123_api +from petstore_api.model.client import Client +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + body = Client( + client="client_example", + ) # Client | client model + + # example passing only required values which don't have defaults set + try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/File.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/File.md new file mode 100644 index 0000000000000000000000000000000000000000..63b1d1a65186f27d04a99c10a66f7f3d0dde447f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/File.md @@ -0,0 +1,12 @@ +# File + +Must be named `File` for test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md new file mode 100644 index 0000000000000000000000000000000000000000..caf2440821daf2c51430b41b1a58ecc049210956 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md @@ -0,0 +1,12 @@ +# FileSchemaTestClass + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md new file mode 100644 index 0000000000000000000000000000000000000000..aef09bfcc83e8afe80acd69406a7e11e049ff97b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md @@ -0,0 +1,23 @@ +# FormatTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**binary** | **file_type** | | [optional] +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md new file mode 100644 index 0000000000000000000000000000000000000000..b6d80a7194575dd4f32848c66348bd421b5143ba --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md @@ -0,0 +1,11 @@ +# Grandparent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**radio_waves** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md new file mode 100644 index 0000000000000000000000000000000000000000..15db0708bb1aa4d4c6492d04330e06c3a4871325 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md @@ -0,0 +1,11 @@ +# GrandparentAnimal + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md new file mode 100644 index 0000000000000000000000000000000000000000..0e1334519a8b2648cae176dfa8d333ac308c3b6e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md @@ -0,0 +1,12 @@ +# HasOnlyReadOnly + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/List.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/List.md new file mode 100644 index 0000000000000000000000000000000000000000..4b60956971aa8983cb144916960189b22430c4a0 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/List.md @@ -0,0 +1,11 @@ +# List + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md new file mode 100644 index 0000000000000000000000000000000000000000..15228ee1f282bc15b37f11748a3a07c394464ae7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md @@ -0,0 +1,14 @@ +# MapTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 0000000000000000000000000000000000000000..f489944a20afcb0a08aa61bdc5a2561c4bfa9dfe --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..c958bd4b33f846bbdc6742175b949b4b069012a3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md @@ -0,0 +1,13 @@ +# Model200Response + +Model for testing model name starting with number + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md new file mode 100644 index 0000000000000000000000000000000000000000..043e9d466fab1f75bed067fe12a48fcbcaa44376 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md @@ -0,0 +1,12 @@ +# ModelReturn + +Model for testing reserved words + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Name.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Name.md new file mode 100644 index 0000000000000000000000000000000000000000..3be719cdbfbac0318f07e0363452e946bb86f2af --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Name.md @@ -0,0 +1,15 @@ +# Name + +Model for testing model name same as property name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] [readonly] + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md new file mode 100644 index 0000000000000000000000000000000000000000..37195c5d89943f572c28f8e2637650449b2c903e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md @@ -0,0 +1,11 @@ +# NumberOnly + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md new file mode 100644 index 0000000000000000000000000000000000000000..119e0f67823949d72a52065670f19ba70441f014 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md @@ -0,0 +1,11 @@ +# NumberWithValidations + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md new file mode 100644 index 0000000000000000000000000000000000000000..5ff4e52033d6cadb1c9d07f446d443108c7d5b0d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md @@ -0,0 +1,14 @@ +# ObjectModelWithRefProps + +a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Order.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Order.md new file mode 100644 index 0000000000000000000000000000000000000000..d29e1a381de899db143d90ef4d2f7802df76830b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Order.md @@ -0,0 +1,16 @@ +# Order + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md new file mode 100644 index 0000000000000000000000000000000000000000..9d3f02d68b3120e43ad4c239a7c53e6643fb0d6f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md @@ -0,0 +1,12 @@ +# Parent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**radio_waves** | **bool** | | [optional] +**tele_vision** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md new file mode 100644 index 0000000000000000000000000000000000000000..569a5e4af14f72d72818bbecc486b94d801502bc --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md @@ -0,0 +1,11 @@ +# ParentAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tele_vision** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md new file mode 100644 index 0000000000000000000000000000000000000000..09e409c8fcf10eef3f5a64d358aae0f357ca7f87 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md @@ -0,0 +1,11 @@ +# ParentPet + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md new file mode 100644 index 0000000000000000000000000000000000000000..6e78495272e45b9932c5050f66d4014f2c2a8177 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md @@ -0,0 +1,16 @@ +# Pet + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**photo_urls** | **[str]** | | +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md new file mode 100644 index 0000000000000000000000000000000000000000..dcff2fcd0727792911d65e16f1fed378156f2db1 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md @@ -0,0 +1,782 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **add_pet** +> add_pet(body) + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet import Pet +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + body = Pet( + id=1, + category=Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example", + ], + tags=[ + Tag( + id=1, + name="name_example", + full_name="full_name_example", + ), + ], + status="available", + ) # Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Add a new pet to the store + api_instance.add_pet(body) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + pet_id = 1 # int | Pet id to delete + api_key = "api_key_example" # str | (optional) + + # example passing only required values which don't have defaults set + try: + # Deletes a pet + api_instance.delete_pet(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_status** +> [Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet import Pet +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + status = [ + "available", + ] # [str] | Status values that need to be considered for filter + + # example passing only required values which don't have defaults set + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **[str]**| Status values that need to be considered for filter | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_tags** +> [Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet import Pet +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + tags = [ + "tags_example", + ] # [str] | Tags to filter by + + # example passing only required values which don't have defaults set + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | **[str]**| Tags to filter by | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet import Pet +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + pet_id = 1 # int | ID of pet to return + + # example passing only required values which don't have defaults set + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet** +> update_pet(body) + +Update an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet import Pet +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + body = Pet( + id=1, + category=Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example", + ], + tags=[ + Tag( + id=1, + name="name_example", + full_name="full_name_example", + ), + ], + status="available", + ) # Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Update an existing pet + api_instance.update_pet(body) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + pet_id = 1 # int | ID of pet that needs to be updated + name = "name_example" # str | Updated name of the pet (optional) + status = "status_example" # str | Updated status of the pet (optional) + + # example passing only required values which don't have defaults set + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file** +> ApiResponse upload_file(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.api_response import ApiResponse +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + pet_id = 1 # int | ID of pet to update + additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) + file = open('/path/to/file', 'rb') # file_type | file to upload (optional) + files = # [file_type] | files to upload (optional) + + # example passing only required values which don't have defaults set + try: + # uploads an image + api_response = api_instance.upload_file(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file_type**| file to upload | [optional] + **files** | **[file_type]**| files to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file_with_required_file** +> ApiResponse upload_file_with_required_file(pet_id, required_file) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +import time +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.api_response import ApiResponse +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + pet_id = 1 # int | ID of pet to update + required_file = open('/path/to/file', 'rb') # file_type | file to upload + additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) + + # example passing only required values which don't have defaults set + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **required_file** | **file_type**| file to upload | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Player.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Player.md new file mode 100644 index 0000000000000000000000000000000000000000..2014198aa1bd183c7676b81fe48a7340a36efa7d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Player.md @@ -0,0 +1,12 @@ +# Player + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**enemy_player** | [**Player**](Player.md) | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md new file mode 100644 index 0000000000000000000000000000000000000000..53b4c61d844572c4c42ddc6d0a8595a23547f29f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md @@ -0,0 +1,12 @@ +# ReadOnlyFirst + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md new file mode 100644 index 0000000000000000000000000000000000000000..268e1134192d09305eab3e5fc28ba257c15341c2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md @@ -0,0 +1,11 @@ +# SpecialModelName + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md new file mode 100644 index 0000000000000000000000000000000000000000..b5df4fc1feea1d66e3a1a0233542baca96bfd58f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md @@ -0,0 +1,285 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +import time +import petstore_api +from petstore_api.api import store_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + order_id = "order_id_example" # str | ID of the order that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +import time +import petstore_api +from petstore_api.api import store_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +import time +import petstore_api +from petstore_api.api import store_api +from petstore_api.model.order import Order +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + order_id = 1 # int | ID of pet that needs to be fetched + + # example passing only required values which don't have defaults set + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **place_order** +> Order place_order(body) + +Place an order for a pet + +### Example + +```python +import time +import petstore_api +from petstore_api.api import store_api +from petstore_api.model.order import Order +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + body = Order( + id=1, + pet_id=1, + quantity=1, + ship_date=dateutil_parser('1970-01-01T00:00:00.00Z'), + status="placed", + complete=False, + ) # Order | order placed for purchasing the pet + + # example passing only required values which don't have defaults set + try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md new file mode 100644 index 0000000000000000000000000000000000000000..217c7970408123314a42f193c98ec42790d6fcc3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md @@ -0,0 +1,11 @@ +# StringBooleanMap + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md new file mode 100644 index 0000000000000000000000000000000000000000..bb195ec0e453ac02d1b0cf15326ad975d10814e2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md @@ -0,0 +1,11 @@ +# StringEnum + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["placed", "approved", "delivered", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md new file mode 100644 index 0000000000000000000000000000000000000000..b9fe1e0944c484a5b31468ca6fe114b9b678cfc8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md @@ -0,0 +1,13 @@ +# Tag + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] +**full_name** | **str** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md new file mode 100644 index 0000000000000000000000000000000000000000..904915aec01057c4d2157625c36a4ade0ba52051 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md @@ -0,0 +1,18 @@ +# TypeHolderDefault + +a model to test optional properties with server defaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_item** | **[int]** | | +**string_item** | **str** | | defaults to "what" +**number_item** | **float** | | defaults to 1.234 +**integer_item** | **int** | | defaults to -2 +**bool_item** | **bool** | | defaults to True +**date_item** | **date** | | [optional] +**datetime_item** | **datetime** | | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md new file mode 100644 index 0000000000000000000000000000000000000000..d2954c64dcef1dc62911856e9728b036d19a20ee --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md @@ -0,0 +1,16 @@ +# TypeHolderExample + +a model to test required properties with an example and length one enum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bool_item** | **bool** | | +**array_item** | **[int]** | | +**string_item** | **str** | | defaults to "what" +**number_item** | **float** | | defaults to 1.234 +**integer_item** | **int** | | defaults to -2 + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/User.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/User.md new file mode 100644 index 0000000000000000000000000000000000000000..b0079f591b6e99f0a61c5ee2a464e9d6b4b2cca2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/User.md @@ -0,0 +1,18 @@ +# User + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md new file mode 100644 index 0000000000000000000000000000000000000000..3c04b81d1967718b9c5e3c488b25f66d0f30929d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md @@ -0,0 +1,562 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + ) # User | Created user object + + # example passing only required values which don't have defaults set + try: + # Create user + api_instance.create_user(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_array_input** +> create_users_with_array_input(body) + +Creates list of users with given input array + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + body = [ + User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + ), + ] # [User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_list_input** +> create_users_with_list_input(body) + +Creates list of users with given input array + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + body = [ + User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + ), + ] # [User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + username = "username_example" # str | The name that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete user + api_instance.delete_user(username) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + username = "username_example" # str | The name that needs to be fetched. Use user1 for testing. + + # example passing only required values which don't have defaults set + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + username = "username_example" # str | The user name for login + password = "password_example" # str | The password for login in clear text + + # example passing only required values which don't have defaults set + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> | +**400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Logs out current logged in user session + api_instance.logout_user() + except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> update_user(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +import time +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user import User +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + username = "username_example" # str | name that need to be deleted + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + ) # User | Updated user object + + # example passing only required values which don't have defaults set + try: + # Updated user + api_instance.update_user(username, body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[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/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md new file mode 100644 index 0000000000000000000000000000000000000000..ea3d7f92804b7370dca179060dccc2e5221c6e06 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md @@ -0,0 +1,39 @@ +# XmlItem + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attribute_string** | **str** | | [optional] +**attribute_number** | **float** | | [optional] +**attribute_integer** | **int** | | [optional] +**attribute_boolean** | **bool** | | [optional] +**wrapped_array** | **[int]** | | [optional] +**name_string** | **str** | | [optional] +**name_number** | **float** | | [optional] +**name_integer** | **int** | | [optional] +**name_boolean** | **bool** | | [optional] +**name_array** | **[int]** | | [optional] +**name_wrapped_array** | **[int]** | | [optional] +**prefix_string** | **str** | | [optional] +**prefix_number** | **float** | | [optional] +**prefix_integer** | **int** | | [optional] +**prefix_boolean** | **bool** | | [optional] +**prefix_array** | **[int]** | | [optional] +**prefix_wrapped_array** | **[int]** | | [optional] +**namespace_string** | **str** | | [optional] +**namespace_number** | **float** | | [optional] +**namespace_integer** | **int** | | [optional] +**namespace_boolean** | **bool** | | [optional] +**namespace_array** | **[int]** | | [optional] +**namespace_wrapped_array** | **[int]** | | [optional] +**prefix_ns_string** | **str** | | [optional] +**prefix_ns_number** | **float** | | [optional] +**prefix_ns_integer** | **int** | | [optional] +**prefix_ns_boolean** | **bool** | | [optional] +**prefix_ns_array** | **[int]** | | [optional] +**prefix_ns_wrapped_array** | **[int]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/git_push.sh b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/git_push.sh new file mode 100644 index 0000000000000000000000000000000000000000..ced3be2b0c7b2349ff06d18da19d4b31435c9fa6 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..26dd6f84e215968ff13f386e7c937f8c0a15b31d --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py @@ -0,0 +1,27 @@ +# flake8: noqa + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +__version__ = "1.0.0" + +# import ApiClient +from petstore_api.api_client import ApiClient + +# import Configuration +from petstore_api.configuration import Configuration + +# import exceptions +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiAttributeError +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..840e9f0cd908aaf6dd88c7c03015f89b8e551d58 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py @@ -0,0 +1,3 @@ +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from petstore_api.apis import AnotherFakeApi diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py new file mode 100644 index 0000000000000000000000000000000000000000..9c75f7d5a83e7d3b7c7f313bd4aa02089e088f81 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -0,0 +1,155 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.client import Client + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __call_123_test_special_tags( + self, + body, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py new file mode 100644 index 0000000000000000000000000000000000000000..aaf44e6f64c891b93fde1a128a275256ce41d54f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -0,0 +1,2223 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.client import Client +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.user import User +from petstore_api.model.xml_item import XmlItem + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_model = _Endpoint( + settings={ + 'response_type': (AnimalFarm,), + 'auth': [], + 'endpoint_path': '/fake/refs/arraymodel', + 'operation_id': 'array_model', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (AnimalFarm,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__array_model + ) + + def __boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.boolean = _Endpoint( + settings={ + 'response_type': (bool,), + 'auth': [], + 'endpoint_path': '/fake/refs/boolean', + 'operation_id': 'boolean', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (bool,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__boolean + ) + + def __create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.call_with_http_info(**kwargs) + + self.create_xml_item = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/create_xml_item', + 'operation_id': 'create_xml_item', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'xml_item', + ], + 'required': [ + 'xml_item', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'xml_item': + (XmlItem,), + }, + 'attribute_map': { + }, + 'location_map': { + 'xml_item': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/xml', + 'application/xml; charset=utf-8', + 'application/xml; charset=utf-16', + 'text/xml', + 'text/xml; charset=utf-8', + 'text/xml; charset=utf-16' + ] + }, + api_client=api_client, + callable=__create_xml_item + ) + + def __number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.number_with_validations = _Endpoint( + settings={ + 'response_type': (NumberWithValidations,), + 'auth': [], + 'endpoint_path': '/fake/refs/number', + 'operation_id': 'number_with_validations', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (NumberWithValidations,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__number_with_validations + ) + + def __object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.object_model_with_ref_props = _Endpoint( + settings={ + 'response_type': (ObjectModelWithRefProps,), + 'auth': [], + 'endpoint_path': '/fake/refs/object_model_with_ref_props', + 'operation_id': 'object_model_with_ref_props', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (ObjectModelWithRefProps,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__object_model_with_ref_props + ) + + def __string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string = _Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/fake/refs/string', + 'operation_id': 'string', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (str,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__string + ) + + def __string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string_enum = _Endpoint( + settings={ + 'response_type': (StringEnum,), + 'auth': [], + 'endpoint_path': '/fake/refs/enum', + 'operation_id': 'string_enum', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (StringEnum,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__string_enum + ) + + def __test_body_with_file_schema( + self, + body, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + Args: + body (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (FileSchemaTestClass,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params( + self, + query, + body, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + Args: + query (str): + body (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'query', + 'body', + ], + 'required': [ + 'query', + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': + (str,), + 'body': + (User,), + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model( + self, + body, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_client_model = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_enums_length_one( + self, + query_integer=3, + query_string="brillig", + path_string="hello", + path_integer=34, + header_number=1.234, + **kwargs + ): + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to "brillig", must be one of ["brillig"] + path_string (str): defaults to "hello", must be one of ["hello"] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number + return self.call_with_http_info(**kwargs) + + self.test_endpoint_enums_length_one = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}', + 'operation_id': 'test_endpoint_enums_length_one', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'required': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'nullable': [ + ], + 'enum': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('query_integer',): { + + "3": 3 + }, + ('query_string',): { + + "BRILLIG": "brillig" + }, + ('path_string',): { + + "HELLO": "hello" + }, + ('path_integer',): { + + "34": 34 + }, + ('header_number',): { + + "1.234": 1.234 + }, + }, + 'openapi_types': { + 'query_integer': + (int,), + 'query_string': + (str,), + 'path_string': + (str,), + 'path_integer': + (int,), + 'header_number': + (float,), + }, + 'attribute_map': { + 'query_integer': 'query_integer', + 'query_string': 'query_string', + 'path_string': 'path_string', + 'path_integer': 'path_integer', + 'header_number': 'header_number', + }, + 'location_map': { + 'query_integer': 'query', + 'query_string': 'query', + 'path_string': 'path', + 'path_integer': 'path', + 'header_number': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_endpoint_enums_length_one + ) + + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ # noqa: E501 + + Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': + (float,), + 'double': + (float,), + 'pattern_without_delimiter': + (str,), + 'byte': + (str,), + 'integer': + (int,), + 'int32': + (int,), + 'int64': + (int,), + 'float': + (float,), + 'string': + (str,), + 'binary': + (file_type,), + 'date': + (date,), + 'date_time': + (datetime,), + 'password': + (str,), + 'param_callback': + (str,), + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': + ([str],), + 'enum_header_string': + (str,), + 'enum_query_string_array': + ([str],), + 'enum_query_string': + (str,), + 'enum_query_integer': + (int,), + 'enum_query_double': + (float,), + 'enum_form_string_array': + ([str],), + 'enum_form_string': + (str,), + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'csv', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': + (int,), + 'required_boolean_group': + (bool,), + 'required_int64_group': + (int,), + 'string_group': + (int,), + 'boolean_group': + (bool,), + 'int64_group': + (int,), + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties( + self, + param, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'param', + ], + 'required': [ + 'param', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': + ({str: (str,)},), + }, + 'attribute_map': { + }, + 'location_map': { + 'param': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': + (str,), + 'param2': + (str,), + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py new file mode 100644 index 0000000000000000000000000000000000000000..1d1afc214c14444df8d3ef20ad36cd301be66a65 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,157 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_classname = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py new file mode 100644 index 0000000000000000000000000000000000000000..2989ca8d4ab7a6cf04360d80e11c8623cb98de69 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -0,0 +1,1170 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.pet import Pet + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __add_pet( + self, + body, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.add_pet = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'api_key': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = _Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': + ([str],), + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = _Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': + ([str],), + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = _Endpoint( + settings={ + 'response_type': (Pet,), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet( + self, + body, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_pet = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'name': + (str,), + 'status': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file( + self, + pet_id, + **kwargs + ): + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = _Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + 'files', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'additional_metadata': + (str,), + 'file': + (file_type,), + 'files': + ([file_type],), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + 'files': 'files', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + 'files': 'form', + }, + 'collection_format_map': { + 'files': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = _Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'required_file': + (file_type,), + 'additional_metadata': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py new file mode 100644 index 0000000000000000000000000000000000000000..c30ca943b2dcc195fb5eb0a001ef40f72fe8de99 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -0,0 +1,499 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.order import Order + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (str,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.get_inventory = _Endpoint( + settings={ + 'response_type': ({str: (int,)},), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = _Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (int,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order( + self, + body, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.place_order = _Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Order,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__place_order + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ef0d5c309240a5661e6986af6d6cc9c12da794 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -0,0 +1,962 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.user import User + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_user( + self, + body, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + Args: + body (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_user = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (User,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = _Endpoint( + settings={ + 'response_type': (User,), + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = _Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'password': + (str,), + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.logout_user = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user( + self, + username, + body, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + body (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_user = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'username', + 'body', + ], + 'required': [ + 'username', + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'body': + (User,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__update_user + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..a43e4ace2427d3fd4e1e4811c41d9f96cef797de --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -0,0 +1,849 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import json +import atexit +import mimetypes +from multiprocessing.pool import ThreadPool +import io +import os +import re +import typing +from urllib.parse import quote +from urllib3.fields import RequestField + + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + ModelComposed, + check_allowed_values, + check_validations, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + none_type, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + if header_params['Content-Type'].startswith("multipart"): + post_params = self.parameters_to_multipart(post_params, + (dict) ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') + raise e + + self.last_response = response_data + + return_data = response_data + + if not _preload_content: + return (return_data) + return return_data + + # deserialize response data + if response_type: + if response_type != (file_type,): + encoding = "utf-8" + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + if match: + encoding = match.group(1) + response_data.data = response_data.data.decode(encoding) + + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def parameters_to_multipart(self, params, collection_types): + """Get parameters as list of tuples, formatting as json if value is collection_types + + :param params: Parameters as list of two-tuples + :param dict collection_types: Parameter collection types + :return: Parameters as list of tuple or urllib3.fields.RequestField + """ + new_params = [] + if collection_types is None: + collection_types = (dict) + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json + v = json.dumps(v, ensure_ascii=False).encode("utf-8") + field = RequestField(k, v) + field.make_multipart(content_type="application/json; charset=utf-8") + new_params.append(field) + else: + new_params.append((k, v)) + return new_params + + @classmethod + def sanitize_for_serialization(cls, obj): + """Prepares data for transmission before it is sent with the rest client + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + If obj is io.IOBase, return the bytes + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, io.IOBase): + return cls.get_file_data_and_close_file(obj) + elif isinstance(obj, (str, int, float, none_type, bool)): + return obj + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + elif isinstance(obj, ModelSimple): + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + :type _check_type: bool + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :type files: dict + :param async_req bool: execute request asynchronously + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :type collection_formats: dict, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :type _check_type: bool, optional + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + @staticmethod + def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: + file_data = file_instance.read() + file_instance.close() + return file_data + + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in files.items(): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = self.get_file_data_and_close_file(file_instance) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (none_type, int), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param], + configuration=self.api_client.configuration + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in kwargs.items(): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in kwargs.items(): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + + api_instance = AnotherFakeApi() + api_instance.call_123_test_special_tags # this is an instance of the class Endpoint + api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() + which then invokes the callable functions stored in that endpoint at + api_instance.call_123_test_special_tags.callable or self.callable in this class + + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + index = self.api_client.configuration.server_operation_index.get( + self.settings['operation_id'], self.api_client.configuration.server_index + ) if kwargs['_host_index'] is None else kwargs['_host_index'] + server_variables = self.api_client.configuration.server_operation_variables.get( + self.settings['operation_id'], self.api_client.configuration.server_variables + ) + _host = self.api_client.configuration.get_host_from_settings( + index, variables=server_variables, servers=self.settings['servers'] + ) + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in kwargs.items(): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e4c52458a0c2f28d7dafd56929be425e89fe432e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py @@ -0,0 +1,22 @@ + +# flake8: noqa + +# Import all APIs into this package. +# If you have many APIs here with many many models used in each API this may +# raise a `RecursionError`. +# In order to avoid this, import only the API that you directly need like: +# +# from .api.another_fake_api import AnotherFakeApi +# +# or import this package, but before doing it, use: +# +# import sys +# sys.setrecursionlimit(n) + +# Import APIs into API package: +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..ccd984b7f5f8f881b2d6056b3b41d24fe575ebac --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py @@ -0,0 +1,511 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +from http import client as http_client +from petstore_api.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + access_token=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.access_token = access_token + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'api_key' in self.api_key: + auth['api_key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix( + 'api_key', + ), + } + if 'api_key_query' in self.api_key: + auth['api_key_query'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix( + 'api_key_query', + ), + } + if self.username is not None and self.password is not None: + auth['http_basic_test'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + if self.access_token is not None: + auth['petstore_auth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://petstore.swagger.io:80/v2", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..51527f6061124b4bb6e43ec1ff15e24cc8a4031f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py @@ -0,0 +1,159 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class NotFoundException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cfe32b7849264791bb2e82491f6fab88a1e73564 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}.models import ModelA, ModelB diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py new file mode 100644 index 0000000000000000000000000000000000000000..7239795cf4afad75010e3d1267e54e11cad30505 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesAnyType(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesAnyType - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py new file mode 100644 index 0000000000000000000000000000000000000000..7d9403758a0da6e89b22c98e66c8f556fd1d2e84 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesArray(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ([bool, date, datetime, dict, float, int, list, str, none_type],) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesArray - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py new file mode 100644 index 0000000000000000000000000000000000000000..ca129b766ec5e56c2226ffd5aa83cf65a94d99d5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesBoolean(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesBoolean - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py new file mode 100644 index 0000000000000000000000000000000000000000..292f467aaa8a39aa00fb4f612f56fa07ae9a2cff --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py @@ -0,0 +1,196 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_string': ({str: (str,)},), # noqa: E501 + 'map_number': ({str: (float,)},), # noqa: E501 + 'map_integer': ({str: (int,)},), # noqa: E501 + 'map_boolean': ({str: (bool,)},), # noqa: E501 + 'map_array_integer': ({str: ([int],)},), # noqa: E501 + 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)},), # noqa: E501 + 'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)},), # noqa: E501 + 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'anytype_2': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'anytype_3': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'map_string': 'map_string', # noqa: E501 + 'map_number': 'map_number', # noqa: E501 + 'map_integer': 'map_integer', # noqa: E501 + 'map_boolean': 'map_boolean', # noqa: E501 + 'map_array_integer': 'map_array_integer', # noqa: E501 + 'map_array_anytype': 'map_array_anytype', # noqa: E501 + 'map_map_string': 'map_map_string', # noqa: E501 + 'map_map_anytype': 'map_map_anytype', # noqa: E501 + 'anytype_1': 'anytype_1', # noqa: E501 + 'anytype_2': 'anytype_2', # noqa: E501 + 'anytype_3': 'anytype_3', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_string ({str: (str,)}): [optional] # noqa: E501 + map_number ({str: (float,)}): [optional] # noqa: E501 + map_integer ({str: (int,)}): [optional] # noqa: E501 + map_boolean ({str: (bool,)}): [optional] # noqa: E501 + map_array_integer ({str: ([int],)}): [optional] # noqa: E501 + map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 + map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 + anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 + anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py new file mode 100644 index 0000000000000000000000000000000000000000..87d78bf36005547383230f0e58f7f529cb6f1b51 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesInteger(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesInteger - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py new file mode 100644 index 0000000000000000000000000000000000000000..b10bd036ff3f4729c426c719d8760f447b4c4585 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesNumber(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (float,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesNumber - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py new file mode 100644 index 0000000000000000000000000000000000000000..000653f13a73594192097af2689a8acfc1714086 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py new file mode 100644 index 0000000000000000000000000000000000000000..7f1f94aa6b6b0bc00a846439b57f017fea5c0f36 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AdditionalPropertiesString(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (str,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesString - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py new file mode 100644 index 0000000000000000000000000000000000000000..a3d48b6ea97538be659a8e85c4af51af9f6cca07 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py @@ -0,0 +1,185 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Cat': Cat, + 'Dog': Dog, + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py new file mode 100644 index 0000000000000000000000000000000000000000..838b18a1297081865e6fb98fed3495154603f168 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py @@ -0,0 +1,184 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal + + +class AnimalFarm(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([Animal],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """AnimalFarm - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([Animal]): # noqa: E501 + + Keyword Args: + value ([Animal]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py new file mode 100644 index 0000000000000000000000000000000000000000..01e2175b8004e1e12e26f4e37b0ed08a44384675 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..008b74dd42a3dba68a613c14fc18796163305889 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_array_number': ([[float]],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_array_number ([[float]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..f2e080bc258ecef70e7f4f4345c1691107b752a1 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_number': ([float],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_number': 'ArrayNumber', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_number ([float]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ac42b07b93c9a525df0b5fc14ba55c32aebc324f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py @@ -0,0 +1,177 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py new file mode 100644 index 0000000000000000000000000000000000000000..710c17e51a56e9c0e2eef5475cadca09d434a62a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py @@ -0,0 +1,181 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Capitalization - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py new file mode 100644 index 0000000000000000000000000000000000000000..fd8d4bc7179c682c265da20ee62fa32e80a3d3e9 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py @@ -0,0 +1,218 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf + + +class Cat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'declawed': 'declawed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Cat - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Animal, + CatAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..50b046510dfaa37582c93936ac3c573e9ea69bf0 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class CatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'declawed': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'declawed': 'declawed', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CatAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + declawed (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py new file mode 100644 index 0000000000000000000000000000000000000000..ed167471d35664c90ae5f591c851aa2a6c24bc85 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py @@ -0,0 +1,173 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'id': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to "default-name" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + """ + + name = kwargs.get('name', "default-name") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py new file mode 100644 index 0000000000000000000000000000000000000000..d36723dd6250e5269f6e1a84da0f46f896d1e3b0 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py @@ -0,0 +1,215 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_all_of import ChildAllOf + from petstore_api.model.parent import Parent + globals()['ChildAllOf'] = ChildAllOf + globals()['Parent'] = Parent + + +class Child(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'radio_waves': (bool,), # noqa: E501 + 'tele_vision': (bool,), # noqa: E501 + 'inter_net': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'radio_waves': 'radioWaves', # noqa: E501 + 'tele_vision': 'teleVision', # noqa: E501 + 'inter_net': 'interNet', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Child - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + radio_waves (bool): [optional] # noqa: E501 + tele_vision (bool): [optional] # noqa: E501 + inter_net (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChildAllOf, + Parent, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..2339e520bd6546b924ab92dadbc7b6697669d889 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ChildAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'inter_net': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'inter_net': 'interNet', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + inter_net (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py new file mode 100644 index 0000000000000000000000000000000000000000..70438f3441ff273419bf106926ed0aa0f31c426e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py @@ -0,0 +1,215 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet + + +class ChildCat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildCat - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChildCatAllOf, + ParentPet, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..f0f1a1ae6bd46c871864ab289ab349193c76b621 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ChildCatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildCatAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py new file mode 100644 index 0000000000000000000000000000000000000000..df4956266ae6df1eec61b375cecb5856c82ff82f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py @@ -0,0 +1,215 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_dog_all_of import ChildDogAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildDogAllOf'] = ChildDogAllOf + globals()['ParentPet'] = ParentPet + + +class ChildDog(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + 'bark': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + 'bark': 'bark', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildDog - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bark (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChildDogAllOf, + ParentPet, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..d460b68b3d3adcf9fcd6d7f60898fa6c33324ef3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ChildDogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bark': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bark': 'bark', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildDogAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bark (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py new file mode 100644 index 0000000000000000000000000000000000000000..1f50ba403ed16dfe74682c5d8751ac347939e2dc --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py @@ -0,0 +1,215 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_lizard_all_of import ChildLizardAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildLizardAllOf'] = ChildLizardAllOf + globals()['ParentPet'] = ParentPet + + +class ChildLizard(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + 'loves_rocks': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + 'loves_rocks': 'lovesRocks', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildLizard - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + loves_rocks (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChildLizardAllOf, + ParentPet, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..669b9338d796cb18e3f424a28f585da28bbf41b8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ChildLizardAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'loves_rocks': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'loves_rocks': 'lovesRocks', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildLizardAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + loves_rocks (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py new file mode 100644 index 0000000000000000000000000000000000000000..18c16f89f908c05047e2b217643a690890df041c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_class': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_class': '_class', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ClassModel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py new file mode 100644 index 0000000000000000000000000000000000000000..da615c54773113cf651c11f07635e2edb4b0c5d7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'client': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'client': 'client', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Client - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + client (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py new file mode 100644 index 0000000000000000000000000000000000000000..e29ffa33602985b89f4ff35a052a953a2f4e6c60 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py @@ -0,0 +1,218 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf + + +class Dog(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'breed': 'breed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Dog - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Animal, + DogAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..b7b2e7db66d9a119ab7ce5523d7ea99f8a10cf2a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class DogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'breed': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'breed': 'breed', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DogAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + breed (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py new file mode 100644 index 0000000000000000000000000000000000000000..43ebac57de38367e7566dd830b193ed380c26b47 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py @@ -0,0 +1,177 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py new file mode 100644 index 0000000000000000000000000000000000000000..14188ca31d2839d23e1eafae39a0a900da72ffb9 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py @@ -0,0 +1,180 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EnumClass - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + + Keyword Args: + value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "-efg" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py new file mode 100644 index 0000000000000000000000000000000000000000..79ba0f6a747caf6f711de769162cab3efdaa8c3a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py @@ -0,0 +1,204 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'enum_string_required': (str,), # noqa: E501 + 'enum_string': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_string': 'enum_string', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'string_enum': 'stringEnum', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.enum_string_required = enum_string_required + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py new file mode 100644 index 0000000000000000000000000000000000000000..a38cccacc6abba832392b9c245077173f9878f9b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'source_uri': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'source_uri': 'sourceURI', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """File - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py new file mode 100644 index 0000000000000000000000000000000000000000..b8c519ed9c7c1f9347c45de3e0f48eaff3cb25e4 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py @@ -0,0 +1,174 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py new file mode 100644 index 0000000000000000000000000000000000000000..494ce2646da094a131e803bc32f55625ddbccc3c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py @@ -0,0 +1,243 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('byte',): { + 'regex': { + 'pattern': r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', # noqa: E501 + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'^[a-z]+$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'number': 'number', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'date': 'date', # noqa: E501 + 'password': 'password', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.number = number + self.byte = byte + self.date = date + self.password = password + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py new file mode 100644 index 0000000000000000000000000000000000000000..a52744cc3e24be29c9182df480b065346a302c72 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Grandparent(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'radio_waves': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'radio_waves': 'radioWaves', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Grandparent - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + radio_waves (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py new file mode 100644 index 0000000000000000000000000000000000000000..48d3f6d9f0b3ea174ba7ba0bc7b5592cdcdf683c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py @@ -0,0 +1,188 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['ParentPet'] = ParentPet + + +class GrandparentAnimal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, + 'ParentPet': ParentPet, + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + """GrandparentAnimal - a model defined in OpenAPI + + Args: + pet_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pet_type = pet_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py new file mode 100644 index 0000000000000000000000000000000000000000..c94781ae2c462240fc093c18cadef278a4ee857b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py @@ -0,0 +1,169 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py new file mode 100644 index 0000000000000000000000000000000000000000..09c762d6a79421da4b99e9981e7614b0746c65ec --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class List(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_123_list': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_123_list': '123-list', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """List - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _123_list (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py new file mode 100644 index 0000000000000000000000000000000000000000..169fb9d88ee0d30261cee78c2747dc4679adb648 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py @@ -0,0 +1,184 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """MapTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py new file mode 100644 index 0000000000000000000000000000000000000000..01df80d9d62b3a734d65f1412df9c810e497cb22 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,177 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..46b155b65239225575decfb2ba17d2b9ae43b68c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py @@ -0,0 +1,169 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Model200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py new file mode 100644 index 0000000000000000000000000000000000000000..377b3507a8b3e3ecbf6c3a784d86b4f925c5a7e9 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_return': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_return': 'return', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _return (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py new file mode 100644 index 0000000000000000000000000000000000000000..1432e185ad6b33a2ec2707e74423f168b3ec8f10 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py @@ -0,0 +1,178 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, *args, **kwargs): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..d4892dbede5b53f15e2a614ace9ebf3155cb1355 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_number': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'just_number': 'JustNumber', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_number (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py new file mode 100644 index 0000000000000000000000000000000000000000..458a7945975144b44a566e831bda1736aeaf3f88 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py @@ -0,0 +1,183 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class NumberWithValidations(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'inclusive_maximum': 2E+1, + 'inclusive_minimum': 1E+1, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (float,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """NumberWithValidations - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (float): # noqa: E501 + + Keyword Args: + value (float): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py new file mode 100644 index 0000000000000000000000000000000000000000..b1dc4bf82e2cb17fc154a70973bba2848ac20bb8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py @@ -0,0 +1,177 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['NumberWithValidations'] = NumberWithValidations + + +class ObjectModelWithRefProps(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'my_number': (NumberWithValidations,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ObjectModelWithRefProps - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + my_number (NumberWithValidations): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py new file mode 100644 index 0000000000000000000000000000000000000000..b42f066848abdeac9684274b463a6aab5d703dda --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py @@ -0,0 +1,186 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Order - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py new file mode 100644 index 0000000000000000000000000000000000000000..b07448d9e1fe51fa156456fd86b06718f7232a76 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py @@ -0,0 +1,212 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.grandparent import Grandparent + from petstore_api.model.parent_all_of import ParentAllOf + globals()['Grandparent'] = Grandparent + globals()['ParentAllOf'] = ParentAllOf + + +class Parent(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'radio_waves': (bool,), # noqa: E501 + 'tele_vision': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'radio_waves': 'radioWaves', # noqa: E501 + 'tele_vision': 'teleVision', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Parent - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + radio_waves (bool): [optional] # noqa: E501 + tele_vision (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Grandparent, + ParentAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..0d109f25a4c277f66fee4d202366f0ce32b0fca5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ParentAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'tele_vision': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'tele_vision': 'teleVision', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ParentAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tele_vision (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py new file mode 100644 index 0000000000000000000000000000000000000000..597e30bb9c4a35cc980ba554c90a556fbcf7d34e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py @@ -0,0 +1,219 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['GrandparentAnimal'] = GrandparentAnimal + + +class ParentPet(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ParentPet - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + GrandparentAnimal, + ], + 'oneOf': [ + ], + } diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py new file mode 100644 index 0000000000000000000000000000000000000000..e9f1e30a3196009737f3fcd5d85018ea1c755673 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py @@ -0,0 +1,197 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'id': (int,), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.photo_urls = photo_urls + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py new file mode 100644 index 0000000000000000000000000000000000000000..6e4485fb65003cb6e1f576bf7cab135404a214c5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Player(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'enemy_player': (Player,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'enemy_player': 'enemyPlayer', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, *args, **kwargs): # noqa: E501 + """Player - a model defined in OpenAPI + + Args: + name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enemy_player (Player): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py new file mode 100644 index 0000000000000000000000000000000000000000..5c68eab91ea391b3496a9a69b5db0800bbdaeff1 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py @@ -0,0 +1,169 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py new file mode 100644 index 0000000000000000000000000000000000000000..823e77596636c81d969e568a0b36e6e56ddb56ba --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py @@ -0,0 +1,166 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'special_property_name': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'special_property_name': '$special[property.name]', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + special_property_name (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py new file mode 100644 index 0000000000000000000000000000000000000000..4ac52699183935a865ecffc87d75032511063503 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py @@ -0,0 +1,169 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py new file mode 100644 index 0000000000000000000000000000000000000000..37dc04332cac7544e60b8464aaf3798c2b366011 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py @@ -0,0 +1,184 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class StringEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """StringEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py new file mode 100644 index 0000000000000000000000000000000000000000..d3dcb78b7ea05c0727b989591010ecb82c39e23a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py @@ -0,0 +1,172 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'full_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'full_name': 'fullName', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + full_name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py new file mode 100644 index 0000000000000000000000000000000000000000..324b131f3a2d6fc2587d75d28e2c377659f1c323 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py @@ -0,0 +1,195 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class TypeHolderDefault(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'string_item': (str,), # noqa: E501 + 'number_item': (float,), # noqa: E501 + 'integer_item': (int,), # noqa: E501 + 'bool_item': (bool,), # noqa: E501 + 'array_item': ([int],), # noqa: E501 + 'date_item': (date,), # noqa: E501 + 'datetime_item': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'string_item': 'string_item', # noqa: E501 + 'number_item': 'number_item', # noqa: E501 + 'integer_item': 'integer_item', # noqa: E501 + 'bool_item': 'bool_item', # noqa: E501 + 'array_item': 'array_item', # noqa: E501 + 'date_item': 'date_item', # noqa: E501 + 'datetime_item': 'datetime_item', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, array_item, *args, **kwargs): # noqa: E501 + """TypeHolderDefault - a model defined in OpenAPI + + Args: + array_item ([int]): + + Keyword Args: + string_item (str): defaults to "what" # noqa: E501 + number_item (float): defaults to 1.234 # noqa: E501 + integer_item (int): defaults to -2 # noqa: E501 + bool_item (bool): defaults to True # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + date_item (date): [optional] # noqa: E501 + datetime_item (datetime): [optional] # noqa: E501 + """ + + string_item = kwargs.get('string_item', "what") + number_item = kwargs.get('number_item', 1.234) + integer_item = kwargs.get('integer_item', -2) + bool_item = kwargs.get('bool_item', True) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.string_item = string_item + self.number_item = number_item + self.integer_item = integer_item + self.bool_item = bool_item + self.array_item = array_item + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py new file mode 100644 index 0000000000000000000000000000000000000000..30bbba178f4f8e8b6e37e4d3e86029702c32c288 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py @@ -0,0 +1,197 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class TypeHolderExample(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('string_item',): { + 'WHAT': "what", + }, + ('number_item',): { + '1.234': 1.234, + }, + ('integer_item',): { + '-2': -2, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'string_item': (str,), # noqa: E501 + 'number_item': (float,), # noqa: E501 + 'integer_item': (int,), # noqa: E501 + 'bool_item': (bool,), # noqa: E501 + 'array_item': ([int],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'string_item': 'string_item', # noqa: E501 + 'number_item': 'number_item', # noqa: E501 + 'integer_item': 'integer_item', # noqa: E501 + 'bool_item': 'bool_item', # noqa: E501 + 'array_item': 'array_item', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 + """TypeHolderExample - a model defined in OpenAPI + + Args: + bool_item (bool): + array_item ([int]): + + Keyword Args: + string_item (str): defaults to "what", must be one of ["what", ] # noqa: E501 + number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501 + integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + string_item = kwargs.get('string_item', "what") + number_item = kwargs.get('number_item', 1.234) + integer_item = kwargs.get('integer_item', -2) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.string_item = string_item + self.number_item = number_item + self.integer_item = integer_item + self.bool_item = bool_item + self.array_item = array_item + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py new file mode 100644 index 0000000000000000000000000000000000000000..9a3cd08141142907060876b5f06badf5fdde79fd --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py @@ -0,0 +1,187 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py new file mode 100644 index 0000000000000000000000000000000000000000..8401b3f40076edeba9c02a2e8bafcb74c5287344 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py @@ -0,0 +1,250 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class XmlItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'attribute_string': (str,), # noqa: E501 + 'attribute_number': (float,), # noqa: E501 + 'attribute_integer': (int,), # noqa: E501 + 'attribute_boolean': (bool,), # noqa: E501 + 'wrapped_array': ([int],), # noqa: E501 + 'name_string': (str,), # noqa: E501 + 'name_number': (float,), # noqa: E501 + 'name_integer': (int,), # noqa: E501 + 'name_boolean': (bool,), # noqa: E501 + 'name_array': ([int],), # noqa: E501 + 'name_wrapped_array': ([int],), # noqa: E501 + 'prefix_string': (str,), # noqa: E501 + 'prefix_number': (float,), # noqa: E501 + 'prefix_integer': (int,), # noqa: E501 + 'prefix_boolean': (bool,), # noqa: E501 + 'prefix_array': ([int],), # noqa: E501 + 'prefix_wrapped_array': ([int],), # noqa: E501 + 'namespace_string': (str,), # noqa: E501 + 'namespace_number': (float,), # noqa: E501 + 'namespace_integer': (int,), # noqa: E501 + 'namespace_boolean': (bool,), # noqa: E501 + 'namespace_array': ([int],), # noqa: E501 + 'namespace_wrapped_array': ([int],), # noqa: E501 + 'prefix_ns_string': (str,), # noqa: E501 + 'prefix_ns_number': (float,), # noqa: E501 + 'prefix_ns_integer': (int,), # noqa: E501 + 'prefix_ns_boolean': (bool,), # noqa: E501 + 'prefix_ns_array': ([int],), # noqa: E501 + 'prefix_ns_wrapped_array': ([int],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'attribute_string': 'attribute_string', # noqa: E501 + 'attribute_number': 'attribute_number', # noqa: E501 + 'attribute_integer': 'attribute_integer', # noqa: E501 + 'attribute_boolean': 'attribute_boolean', # noqa: E501 + 'wrapped_array': 'wrapped_array', # noqa: E501 + 'name_string': 'name_string', # noqa: E501 + 'name_number': 'name_number', # noqa: E501 + 'name_integer': 'name_integer', # noqa: E501 + 'name_boolean': 'name_boolean', # noqa: E501 + 'name_array': 'name_array', # noqa: E501 + 'name_wrapped_array': 'name_wrapped_array', # noqa: E501 + 'prefix_string': 'prefix_string', # noqa: E501 + 'prefix_number': 'prefix_number', # noqa: E501 + 'prefix_integer': 'prefix_integer', # noqa: E501 + 'prefix_boolean': 'prefix_boolean', # noqa: E501 + 'prefix_array': 'prefix_array', # noqa: E501 + 'prefix_wrapped_array': 'prefix_wrapped_array', # noqa: E501 + 'namespace_string': 'namespace_string', # noqa: E501 + 'namespace_number': 'namespace_number', # noqa: E501 + 'namespace_integer': 'namespace_integer', # noqa: E501 + 'namespace_boolean': 'namespace_boolean', # noqa: E501 + 'namespace_array': 'namespace_array', # noqa: E501 + 'namespace_wrapped_array': 'namespace_wrapped_array', # noqa: E501 + 'prefix_ns_string': 'prefix_ns_string', # noqa: E501 + 'prefix_ns_number': 'prefix_ns_number', # noqa: E501 + 'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501 + 'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501 + 'prefix_ns_array': 'prefix_ns_array', # noqa: E501 + 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """XmlItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attribute_string (str): [optional] # noqa: E501 + attribute_number (float): [optional] # noqa: E501 + attribute_integer (int): [optional] # noqa: E501 + attribute_boolean (bool): [optional] # noqa: E501 + wrapped_array ([int]): [optional] # noqa: E501 + name_string (str): [optional] # noqa: E501 + name_number (float): [optional] # noqa: E501 + name_integer (int): [optional] # noqa: E501 + name_boolean (bool): [optional] # noqa: E501 + name_array ([int]): [optional] # noqa: E501 + name_wrapped_array ([int]): [optional] # noqa: E501 + prefix_string (str): [optional] # noqa: E501 + prefix_number (float): [optional] # noqa: E501 + prefix_integer (int): [optional] # noqa: E501 + prefix_boolean (bool): [optional] # noqa: E501 + prefix_array ([int]): [optional] # noqa: E501 + prefix_wrapped_array ([int]): [optional] # noqa: E501 + namespace_string (str): [optional] # noqa: E501 + namespace_number (float): [optional] # noqa: E501 + namespace_integer (int): [optional] # noqa: E501 + namespace_boolean (bool): [optional] # noqa: E501 + namespace_array ([int]): [optional] # noqa: E501 + namespace_wrapped_array ([int]): [optional] # noqa: E501 + prefix_ns_string (str): [optional] # noqa: E501 + prefix_ns_number (float): [optional] # noqa: E501 + prefix_ns_integer (int): [optional] # noqa: E501 + prefix_ns_boolean (bool): [optional] # noqa: E501 + prefix_ns_array ([int]): [optional] # noqa: E501 + prefix_ns_wrapped_array ([int]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..3a555f0a88c43615eb88534c30370f73d7f4489c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py @@ -0,0 +1,1859 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from datetime import date, datetime # noqa: F401 +import inspect +import io +import os +import pprint +import re +import tempfile + +from dateutil.parser import parse + +from petstore_api.exceptions import ( + ApiKeyError, + ApiAttributeError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +file_type = io.IOBase + + +class cached_property(object): + # this caches the result of the function call for fn with no inputs + # use this as a decorator on fuction methods that you want converted + # into cached properties + result_key = '_results' + + def __init__(self, fn): + self._fn = fn + + def __get__(self, instance, cls=None): + if self.result_key in vars(self): + return vars(self)[self.result_key] + else: + result = self._fn() + setattr(self, self.result_key, result) + return result + + +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + def set_attribute(self, name, value): + # this is only used to set properties on self + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._spec_property_naming, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value, + self._configuration + ) + self.__dict__['_data_store'][name] = value + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other + + def __setattr__(self, attr, value): + """set the value of an attribute using dot notation: `instance.attr = val`""" + self[attr] = value + + def __getattr__(self, attr): + """get the value of an attribute using dot notation: `instance.attr`""" + return self.__getitem__(attr) + + def __new__(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return super(OpenApiModel, cls).__new__(cls) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get('_path_to_item', ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return super(OpenApiModel, cls).__new__(cls) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get('allOf') and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = super(OpenApiModel, cls).__new__(cls) + self_inst.__init__(*args, **kwargs) + + new_inst = new_cls.__new__(new_cls, *args, **kwargs) + new_inst.__init__(*args, **kwargs) + return new_inst + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + return self.__dict__['_data_store'].get(name, default) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + if name in self: + return self.get(name) + + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + + def __contains__(self, name): + """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + if name in self.required_properties: + return name in self.__dict__ + + return name in self.__dict__['_data_store'] + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + return vals_equal + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + return self.__dict__['_data_store'].get(name, default) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + if name in self: + return self.get(name) + + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + + def __contains__(self, name): + """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + if name in self.required_properties: + return name in self.__dict__ + + return name in self.__dict__['_data_store'] + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in self._data_store.items(): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not vals_equal: + return False + return True + + +class ModelComposed(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi and have oneOf/allOf/anyOf + + When one sets a property we use var_name_to_model_instances to store the value in + the correct class instances + run any type checking + validation code. + When one gets a property we use var_name_to_model_instances to get the value + from the correct class instances. + This allows multiple composed schemas to contain the same property with additive + constraints on the value. + + _composed_schemas (dict) stores the anyOf/allOf/oneOf classes + key (str): allOf/oneOf/anyOf + value (list): the classes in the XOf definition. + Note: none_type can be included when the openapi document version >= 3.1.0 + _composed_instances (list): stores a list of instances of the composed schemas + defined in _composed_schemas. When properties are accessed in the self instance, + they are returned from the self._data_store or the data stores in the instances + in self._composed_schemas + _var_name_to_model_instances (dict): maps between a variable name on self and + the composed instances (self included) which contain that data + key (str): property name + value (list): list of class instances, self or instances in _composed_instances + which contain the value that the key is referring to. + """ + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None + + __unset_attribute_value__ = object() + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + # get the attribute from the correct instance + model_instances = self._var_name_to_model_instances.get(name) + values = [] + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same + if model_instances: + for model_instance in model_instances: + if name in model_instance._data_store: + v = model_instance._data_store[name] + if v not in values: + values.append(v) + len_values = len(values) + if len_values == 0: + return default + elif len_values == 1: + return values[0] + elif len_values > 1: + raise ApiValueError( + "Values stored for property {0} in {1} differ when looking " + "at self and self's composed instances. All values must be " + "the same".format(name, type(self).__name__), + [e for e in [self._path_to_item, name] if e] + ) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + value = self.get(name, self.__unset_attribute_value__) + if value is self.__unset_attribute_value__: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + return value + + def __contains__(self, name): + """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + + if name in self.required_properties: + return name in self.__dict__ + + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + + if model_instances: + for model_instance in model_instances: + if name in model_instance._data_store: + return True + + return False + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in self._data_store.items(): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not vals_equal: + return False + return True + + +COERCION_INDEX_BY_TYPE = { + ModelComposed: 0, + ModelNormal: 1, + ModelSimple: 2, + none_type: 3, # The type of 'None'. + list: 4, + dict: 5, + float: 6, + int: 7, + bool: 8, + datetime: 9, + date: 10, + str: 11, + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. + (list, ModelComposed), + (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelComposed), + # (list, ModelComposed), + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelComposed), + (list, ModelComposed), + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif isinstance(input_value, str): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def is_json_validation_enabled(schema_keyword, configuration=None): + """Returns true if JSON schema validation is enabled for the specified + validation keyword. This can be used to skip JSON schema structural validation + as requested in the configuration. + + Args: + schema_keyword (string): the name of a JSON schema validation keyword. + configuration (Configuration): the configuration class. + """ + + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) + + +def check_validations( + validations, input_variable_path, input_values, + configuration=None): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary. + input_variable_path (tuple): the path to the input variable. + input_values (list/str/int/float/date/datetime): the values that we + are checking. + configuration (Configuration): the configuration class. + """ + + if input_values is None: + return + + current_validations = validations[input_variable_path] + if (is_json_validation_enabled('multipleOf', configuration) and + 'multiple_of' in current_validations and + isinstance(input_values, (int, float)) and + not (float(input_values) / current_validations['multiple_of']).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + raise ApiValueError( + "Invalid value for `%s`, value must be a multiple of " + "`%s`" % ( + input_variable_path[0], + current_validations['multiple_of'] + ) + ) + + if (is_json_validation_enabled('maxLength', configuration) and + 'max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if (is_json_validation_enabled('minLength', configuration) and + 'min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if (is_json_validation_enabled('maxItems', configuration) and + 'max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if (is_json_validation_enabled('minItems', configuration) and + 'min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if (is_json_validation_enabled('exclusiveMaximum', configuration) and + 'exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('maximum', configuration) and + 'inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('exclusiveMinimum', configuration) and + 'exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('minimum', configuration) and + 'inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if (is_json_validation_enabled('pattern', configuration) and + 'regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'] + ) + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + err_msg = r"%s with flags=`%s`" % (err_msg, flags) + raise ApiValueError(err_msg) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with class information inside it. + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with class information inside it. + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelComposed)): + return COERCION_INDEX_BY_TYPE[ModelComposed] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + elif class_or_instance in COERCION_INDEX_BY_TYPE: + return COERCION_INDEX_BY_TYPE[class_or_instance] + raise ApiValueError("Unsupported type: %s" % class_or_instance) + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + current_item (any): the current item (input data) to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelComposed): + required_type_class_simplified = ModelComposed + elif issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes + + +def get_required_type_classes(required_types_mixed, spec_property_naming): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (dict): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class. + If the input_dict contains a key which does not declared in the model_class, + the key is added to the output dict as is. The assumption is the model_class + may have undeclared properties (additionalProperties attribute in the OAS + document). + """ + + if getattr(model_class, 'attribute_map', None) is None: + return input_dict + output_dict = {} + reversed_attr_map = {value: key for key, value in + model_class.attribute_map.items()} + for javascript_key, value in input_dict.items(): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError) as ex: + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), klass.__name__ + ), + path_to_item=path_to_item + ) from ex + + +def get_discriminator_class(model_class, + discr_name, + discr_value, cls_visited): + """Returns the child class specified by the discriminator. + + Args: + model_class (OpenApiModel): the model class. + discr_name (string): the name of the discriminator property. + discr_value (any): the discriminator value. + cls_visited (list): list of model classes that have been visited. + Used to determine the discriminator class without + visiting circular references indefinitely. + + Returns: + used_model_class (class/None): the chosen child class that will be used + to deserialize the data, for example dog.Dog. + If a class is not found, None is returned. + """ + + if model_class in cls_visited: + # The class has already been visited and no suitable class was found. + return None + cls_visited.append(model_class) + used_model_class = None + if discr_name in model_class.discriminator: + class_name_to_discr_class = model_class.discriminator[discr_name] + used_model_class = class_name_to_discr_class.get(discr_value) + if used_model_class is None: + # We didn't find a discriminated class in class_name_to_discr_class. + # So look in the ancestor or descendant discriminators + # The discriminator mapping may exist in a descendant (anyOf, oneOf) + # or ancestor (allOf). + # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat + # hierarchy, the discriminator mappings may be defined at any level + # in the hierarchy. + # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig + # if we try to make BasquePig from mammal, we need to travel through + # the oneOf descendant discriminators to find BasquePig + descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ + model_class._composed_schemas.get('anyOf', ()) + ancestor_classes = model_class._composed_schemas.get('allOf', ()) + possible_classes = descendant_classes + ancestor_classes + for cls in possible_classes: + # Check if the schema has inherited discriminators. + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + used_model_class = get_discriminator_class( + cls, discr_name, discr_value, cls_visited) + if used_model_class is not None: + return used_model_class + return used_model_class + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, spec_property_naming): + """Deserializes model_data to model instance. + + Args: + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _spec_property_naming=spec_property_naming) + + if issubclass(model_class, ModelSimple): + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) + if isinstance(model_data, dict): + kw_args.update(model_data) + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, spec_property_naming, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelComposed/ModelNormal/ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, spec_property_naming) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + if configuration is None or not configuration.discard_unknown_keys: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, spec_property_naming) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def is_type_nullable(input_type): + """ + Returns true if None is an allowed value for the specified input_type. + + A type is nullable if at least one of the following conditions is true: + 1. The OAS 'nullable' attribute has been specified, + 1. The type is the 'null' type, + 1. The type is a anyOf/oneOf composed schema, and a child schema is + the 'null' type. + Args: + input_type (type): the class of the input_value that we are + checking + Returns: + bool + """ + if input_type is none_type: + return True + if issubclass(input_type, OpenApiModel) and input_type._nullable: + return True + if issubclass(input_type, ModelComposed): + # If oneOf/anyOf, check if the 'null' type is one of the allowed types. + for t in input_type._composed_schemas.get('oneOf', ()): + if is_type_nullable(t): return True + for t in input_type._composed_schemas.get('anyOf', ()): + if is_type_nullable(t): return True + return False + + +def is_valid_type(input_class_simple, valid_classes): + """ + Args: + input_class_simple (class): the class of the input_value that we are + checking + valid_classes (tuple): the valid classes that the current item + should be + Returns: + bool + """ + valid_type = input_class_simple in valid_classes + if not valid_type and ( + issubclass(input_class_simple, OpenApiModel) or + input_class_simple is none_type): + for valid_class in valid_classes: + if input_class_simple is none_type and is_type_nullable(valid_class): + # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. + return True + if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): + continue + discr_propertyname_py = list(valid_class.discriminator.keys())[0] + discriminator_classes = ( + valid_class.discriminator[discr_propertyname_py].values() + ) + valid_type = is_valid_type(input_class_simple, discriminator_classes) + if valid_type: + return True + return valid_type + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + spec_property_naming, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed, spec_property_naming) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = is_valid_type(input_class_simple, valid_classes) + if not valid_type: + if configuration: + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=True, + check_type=_check_type + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, spec_property_naming, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=False, + check_type=_check_type + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + spec_property_naming, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in input_value.items(): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + spec_property_naming, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + model_instances = [model_instance] + if model_instance._composed_schemas: + model_instances.extend(model_instance._composed_instances) + for model_instance in model_instances: + for attr, value in model_instance._data_store.items(): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + attr = model_instance.attribute_map.get(attr, attr) + if isinstance(value, list): + if not value: + # empty list or None + result[attr] = value + else: + res = [] + for v in value: + if isinstance(v, PRIMITIVE_TYPES) or v is None: + res.append(v) + elif isinstance(v, ModelSimple): + res.append(v.value) + else: + res.append(model_to_dict(v, serialize=serialize)) + result[attr] = res + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], + model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], '_data_store') else item, + value.items() + )) + elif isinstance(value, ModelSimple): + result[attr] = value.value + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + """ + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def convert_js_args_to_python_args(fn): + from functools import wraps + @wraps(fn) + def wrapped_init(_self, *args, **kwargs): + """ + An attribute named `self` received from the api will conflicts with the reserved `self` + parameter of a class method. During generation, `self` attributes are mapped + to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. + """ + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: + kwargs = change_keys_js_to_python(kwargs, _self.__class__) + return fn(_self, *args, **kwargs) + return wrapped_init + + +def get_allof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes + + Returns + composed_instances (list) + """ + composed_instances = [] + for allof_class in self._composed_schemas['allOf']: + + try: + allof_instance = allof_class(**model_args, **constant_args) + composed_instances.append(allof_instance) + except Exception as ex: + raise ApiValueError( + "Invalid inputs given to generate an instance of '%s'. The " + "input data was invalid for the allOf schema '%s' in the composed " + "schema '%s'. Error=%s" % ( + allof_class.__name__, + allof_class.__name__, + self.__class__.__name__, + str(ex) + ) + ) from ex + return composed_instances + + +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): + """ + Find the oneOf schema that matches the input data (e.g. payload). + If exactly one schema matches the input data, an instance of that schema + is returned. + If zero or more than one schema match the input data, an exception is raised. + In OAS 3.x, the payload MUST, by validation, match exactly one of the + schemas described by oneOf. + + Args: + cls: the class we are handling + model_kwargs (dict): var_name to var_value + The input data, e.g. the payload that must match a oneOf schema + in the OpenAPI document. + constant_kwargs (dict): var_name to var_value + args that every model requires, including configuration, server + and path to item. + + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + + Returns + oneof_instance (instance) + """ + if len(cls._composed_schemas['oneOf']) == 0: + return None + + oneof_instances = [] + # Iterate over each oneOf schema and determine if the input data + # matches the oneOf schemas. + for oneof_class in cls._composed_schemas['oneOf']: + # The composed oneOf schema allows the 'null' type and the input data + # is the null value. This is a OAS >= 3.1 feature. + if oneof_class is none_type: + # skip none_types because we are deserializing dict data. + # none_type deserialization is handled in the __new__ method + continue + + single_value_input = allows_single_value_input(oneof_class) + + try: + if not single_value_input: + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) + oneof_instances.append(oneof_instance) + except Exception: + pass + if len(oneof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. None " + "of the oneOf schemas matched the input data." % + cls.__name__ + ) + elif len(oneof_instances) > 1: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Multiple " + "oneOf schemas matched the inputs, but a max of one is allowed." % + cls.__name__ + ) + return oneof_instances[0] + + +def get_anyof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + The input data, e.g. the payload that must match at least one + anyOf child schema in the OpenAPI document. + constant_args (dict): var_name to var_value + args that every model requires, including configuration, server + and path to item. + + Returns + anyof_instances (list) + """ + anyof_instances = [] + if len(self._composed_schemas['anyOf']) == 0: + return anyof_instances + + for anyof_class in self._composed_schemas['anyOf']: + # The composed oneOf schema allows the 'null' type and the input data + # is the null value. This is a OAS >= 3.1 feature. + if anyof_class is none_type: + # skip none_types because we are deserializing dict data. + # none_type deserialization is handled in the __new__ method + continue + + try: + anyof_instance = anyof_class(**model_args, **constant_args) + anyof_instances.append(anyof_instance) + except Exception: + pass + if len(anyof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. None of the " + "anyOf schemas matched the inputs." % + self.__class__.__name__ + ) + return anyof_instances + + +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names + # before __init__ was called + for instance in composed_instances: + if instance.__class__ in self._composed_schemas['allOf']: + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + else: + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args + + +def validate_get_composed_info(constant_args, model_args, self): + """ + For composed schemas, generate schema instances for + all schemas in the oneOf/anyOf/allOf definition. If additional + properties are allowed, also assign those properties on + all matched schemas that contain additionalProperties. + Openapi schemas are python classes. + + Exceptions are raised if: + - 0 or > 1 oneOf schema matches the model_args input data + - no anyOf schema matches the model_args input data + - any of the allOf schemas do not match the model_args input data + + Args: + constant_args (dict): these are the args that every model requires + model_args (dict): these are the required and optional spec args that + were passed in to make this model + self (class): the class that we are instantiating + This class contains self._composed_schemas + + Returns: + composed_info (list): length three + composed_instances (list): the composed instances which are not + self + var_name_to_model_instances (dict): a dict going from var_name + to the model_instance which holds that var_name + the model_instance may be self or an instance of one of the + classes in self.composed_instances() + additional_properties_model_instances (list): a list of the + model instances which have the property + additional_properties_type. This list can include self + """ + # create composed_instances + composed_instances = [] + allof_instances = get_allof_instances(self, model_args, constant_args) + composed_instances.extend(allof_instances) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) + if oneof_instance is not None: + composed_instances.append(oneof_instance) + anyof_instances = get_anyof_instances(self, model_args, constant_args) + composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] + + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) + + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances + + return [ + composed_instances, + var_name_to_model_instances, + additional_properties_model_instances, + discarded_args + ] diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..361e2bd9766cd167583de738161356e7274206f3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py @@ -0,0 +1,74 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from petstore_api.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType +from petstore_api.model.additional_properties_array import AdditionalPropertiesArray +from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger +from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber +from petstore_api.model.additional_properties_object import AdditionalPropertiesObject +from petstore_api.model.additional_properties_string import AdditionalPropertiesString +from petstore_api.model.animal import Animal +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly +from petstore_api.model.array_test import ArrayTest +from petstore_api.model.capitalization import Capitalization +from petstore_api.model.cat import Cat +from petstore_api.model.cat_all_of import CatAllOf +from petstore_api.model.category import Category +from petstore_api.model.child import Child +from petstore_api.model.child_all_of import ChildAllOf +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.child_cat_all_of import ChildCatAllOf +from petstore_api.model.child_dog import ChildDog +from petstore_api.model.child_dog_all_of import ChildDogAllOf +from petstore_api.model.child_lizard import ChildLizard +from petstore_api.model.child_lizard_all_of import ChildLizardAllOf +from petstore_api.model.class_model import ClassModel +from petstore_api.model.client import Client +from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf +from petstore_api.model.enum_arrays import EnumArrays +from petstore_api.model.enum_class import EnumClass +from petstore_api.model.enum_test import EnumTest +from petstore_api.model.file import File +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.format_test import FormatTest +from petstore_api.model.grandparent import Grandparent +from petstore_api.model.grandparent_animal import GrandparentAnimal +from petstore_api.model.has_only_read_only import HasOnlyReadOnly +from petstore_api.model.list import List +from petstore_api.model.map_test import MapTest +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.model.model200_response import Model200Response +from petstore_api.model.model_return import ModelReturn +from petstore_api.model.name import Name +from petstore_api.model.number_only import NumberOnly +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.order import Order +from petstore_api.model.parent import Parent +from petstore_api.model.parent_all_of import ParentAllOf +from petstore_api.model.parent_pet import ParentPet +from petstore_api.model.pet import Pet +from petstore_api.model.player import Player +from petstore_api.model.read_only_first import ReadOnlyFirst +from petstore_api.model.special_model_name import SpecialModelName +from petstore_api.model.string_boolean_map import StringBooleanMap +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.tag import Tag +from petstore_api.model.type_holder_default import TypeHolderDefault +from petstore_api.model.type_holder_example import TypeHolderExample +from petstore_api.model.user import User +from petstore_api.model.xml_item import XmlItem diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..a1d580fbe05bae50228f9716ac1f8bad30505856 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py @@ -0,0 +1,292 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import io +import json +import logging +import re +import ssl +from urllib.parse import urlencode + +import urllib3 + +from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + if r.status == 401: + raise UnauthorizedException(http_resp=r) + + if r.status == 403: + raise ForbiddenException(http_resp=r) + + if r.status == 404: + raise NotFoundException(http_resp=r) + + if 500 <= r.status <= 599: + raise ServiceException(http_resp=r) + + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/pom.xml b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..1db0285b1812e26786b917ebe27dc5eb7c2201dc --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/pom.xml @@ -0,0 +1,46 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.openapitools</groupId> + <artifactId>PythonV2PetstoreClientTestsDisallowAdditionalPropertiesIfNotPresent</artifactId> + <packaging>pom</packaging> + <version>1.0-SNAPSHOT</version> + <name>Python OpenAPI Petstore Client</name> + <build> + <plugins> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.2.1</version> + <executions> + <execution> + <id>test</id> + <phase>integration-test</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>make</executable> + <arguments> + <argument>test</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/requirements.txt b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..96947f60408f6be853e953b858348bd17c7bef74 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/requirements.txt @@ -0,0 +1,3 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.cfg b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..11433ee875ab7f4bbc10e8aeb98124c844ce64aa --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..c484eec94f36d504e04d26f5044fb6f140c24aa5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.py @@ -0,0 +1,43 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "urllib3 >= 1.25.3", + "python-dateutil", +] + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.6", + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_description="""\ + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + """ +) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..bb4f22bb7a6e19b31f7a385ae97cba008008cd24 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt @@ -0,0 +1 @@ +pytest-cov>=2.8.1 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py new file mode 100644 index 0000000000000000000000000000000000000000..ce985f76ed9eac9c753c1e261a7d61e28784a27c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType + + +class TestAdditionalPropertiesAnyType(unittest.TestCase): + """AdditionalPropertiesAnyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesAnyType(self): + """Test AdditionalPropertiesAnyType""" + # FIXME: construct object with mandatory attributes with example values + # model = AdditionalPropertiesAnyType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py new file mode 100644 index 0000000000000000000000000000000000000000..f63ca82f6c22b96197011a156eba65b951e1c827 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_array import AdditionalPropertiesArray + + +class TestAdditionalPropertiesArray(unittest.TestCase): + """AdditionalPropertiesArray unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesArray(self): + """Test AdditionalPropertiesArray""" + # can make model without additional properties + model = AdditionalPropertiesArray() + + # can make one with additional properties + import datetime + some_val = [] + model = AdditionalPropertiesArray(some_key=some_val) + assert model['some_key'] == some_val + some_val = [True, datetime.date(1970,1,1), datetime.datetime(1970,1,1), {}, 3.1, 1, [], 'hello'] + model = AdditionalPropertiesArray(some_key=some_val) + assert model['some_key'] == some_val + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesArray(some_key='some string') + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py new file mode 100644 index 0000000000000000000000000000000000000000..e5a13891c0985edc6d2ccb524eb9db0123d0b0bb --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean + + +class TestAdditionalPropertiesBoolean(unittest.TestCase): + """AdditionalPropertiesBoolean unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesBoolean(self): + """Test AdditionalPropertiesBoolean""" + # can make model without additional properties + model = AdditionalPropertiesBoolean() + + # can make one with additional properties + model = AdditionalPropertiesBoolean(some_key=True) + assert model['some_key'] == True + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesBoolean(some_key='True') + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py new file mode 100644 index 0000000000000000000000000000000000000000..befc14455da2e55373cba31c837e5ee410cdcc15 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py new file mode 100644 index 0000000000000000000000000000000000000000..0e08b8f877064b4a94b04720aa6c221b9240553b --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger + + +class TestAdditionalPropertiesInteger(unittest.TestCase): + """AdditionalPropertiesInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesInteger(self): + """Test AdditionalPropertiesInteger""" + # can make model without additional properties + model = AdditionalPropertiesInteger() + + # can make one with additional properties + model = AdditionalPropertiesInteger(some_key=3) + assert model['some_key'] == 3 + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesInteger(some_key=11.3) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py new file mode 100644 index 0000000000000000000000000000000000000000..90f4429e989f00d473c88c9ae18a008f0dc4f196 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber + + +class TestAdditionalPropertiesNumber(unittest.TestCase): + """AdditionalPropertiesNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesNumber(self): + """Test AdditionalPropertiesNumber""" + # can make model without additional properties + model = AdditionalPropertiesNumber() + + # can make one with additional properties + model = AdditionalPropertiesNumber(some_key=11.3) + assert model['some_key'] == 11.3 + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesNumber(some_key=10) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py new file mode 100644 index 0000000000000000000000000000000000000000..ded4a8e8a124760e21315b99a3536e9ff28dca8a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_object import AdditionalPropertiesObject + + +class TestAdditionalPropertiesObject(unittest.TestCase): + """AdditionalPropertiesObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesObject(self): + """Test AdditionalPropertiesObject""" + # can make model without additional properties + model = AdditionalPropertiesObject() + + # can make one with additional properties + some_val = {} + model = AdditionalPropertiesObject(some_key=some_val) + assert model['some_key'] == some_val + import datetime + some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'} + model = AdditionalPropertiesObject(some_key=some_val) + assert model['some_key'] == some_val + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesObject(some_key='some string') + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py new file mode 100644 index 0000000000000000000000000000000000000000..cff2c31921feceda8292ea794c48e832869fffaf --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_string import AdditionalPropertiesString + + +class TestAdditionalPropertiesString(unittest.TestCase): + """AdditionalPropertiesString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesString(self): + """Test AdditionalPropertiesString""" + # can make model without additional properties + model = AdditionalPropertiesString() + + # can make one with additional properties + model = AdditionalPropertiesString(some_key='some_val') + assert model['some_key'] == 'some_val' + + # type checking works on additional properties + with self.assertRaises(petstore_api.ApiTypeError) as exc: + model = AdditionalPropertiesString(some_key=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py new file mode 100644 index 0000000000000000000000000000000000000000..958f303f13e38ba212f9a88033e9ff2d1adf2de7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import cat +except ImportError: + cat = sys.modules[ + 'petstore_api.model.cat'] +try: + from petstore_api.model import dog +except ImportError: + dog = sys.modules[ + 'petstore_api.model.dog'] +from petstore_api.model.animal import Animal + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py new file mode 100644 index 0000000000000000000000000000000000000000..7117d42b430e1cc9e02004ba91fdb0b7fc3f4d8e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +from petstore_api.model.animal_farm import AnimalFarm + + +class TestAnimalFarm(unittest.TestCase): + """AnimalFarm unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimalFarm(self): + """Test AnimalFarm""" + # FIXME: construct object with mandatory attributes with example values + # model = AnimalFarm() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py new file mode 100644 index 0000000000000000000000000000000000000000..f79966a2696190d5bcbfb2d998d1d0c1450c1fa7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py new file mode 100644 index 0000000000000000000000000000000000000000..9db92633f626d3b43c86164d1a3acd9d1dbad05e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.api_response import ApiResponse + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..4980ad17afb574cea0ac1f829e051e04682d5cc8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..479c537cada7dec1c302fe8dd95d6d53cce6efd7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2426b27b7e46dc84eb1a1b1d75604e920d96ece3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import read_only_first +except ImportError: + read_only_first = sys.modules[ + 'petstore_api.model.read_only_first'] +from petstore_api.model.array_test import ArrayTest + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py new file mode 100644 index 0000000000000000000000000000000000000000..20d2649c01ebf47111a7d0eacc1056da31599a2f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.capitalization import Capitalization + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py new file mode 100644 index 0000000000000000000000000000000000000000..64b525aaf118f136b50dc7af345126b80cb438de --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import cat_all_of +except ImportError: + cat_all_of = sys.modules[ + 'petstore_api.model.cat_all_of'] +from petstore_api.model.cat import Cat + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..a5bb91ac864e690f5f2d7a952b14b215cc430e0e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.cat_all_of import CatAllOf + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_category.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_category.py new file mode 100644 index 0000000000000000000000000000000000000000..59b64e5924a8886731379732dd618c6e2a2f847e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_category.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.category import Category + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py new file mode 100644 index 0000000000000000000000000000000000000000..790fc1abc8da8ca543d53279fb590dbc0e517b16 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_all_of +except ImportError: + child_all_of = sys.modules[ + 'petstore_api.model.child_all_of'] +try: + from petstore_api.model import parent +except ImportError: + parent = sys.modules[ + 'petstore_api.model.parent'] +from petstore_api.model.child import Child + + +class TestChild(unittest.TestCase): + """Child unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChild(self): + """Test Child + This will fail because additional_properties_type is None in ChildAllOf and it must be defined as any type + to allow in the property radio_waves which is not defined in ChildAllOf, it is defined in Grandparent + """ + # make an instance of Child, a composed schema model + radio_waves = True + tele_vision = True + inter_net = True + with self.assertRaises(petstore_api.exceptions.ApiValueError): + child = Child( + radio_waves=radio_waves, + tele_vision=tele_vision, + inter_net=inter_net + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..96e479cf0796918fda071002c2ac8f2997a07d01 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.child_all_of import ChildAllOf + + +class TestChildAllOf(unittest.TestCase): + """ChildAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildAllOf(self): + """Test ChildAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py new file mode 100644 index 0000000000000000000000000000000000000000..34c085515a80d3e3243b932612bf95f678c100ea --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_cat_all_of +except ImportError: + child_cat_all_of = sys.modules[ + 'petstore_api.model.child_cat_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_cat import ChildCat + + +class TestChildCat(unittest.TestCase): + """ChildCat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildCat(self): + """Test ChildCat""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildCat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..2a7aab100fbf324fb8b29aaca302553b4c76ff3c --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.child_cat_all_of import ChildCatAllOf + + +class TestChildCatAllOf(unittest.TestCase): + """ChildCatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildCatAllOf(self): + """Test ChildCatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildCatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py new file mode 100644 index 0000000000000000000000000000000000000000..dfb09213e40cafffcb19b3eb43391e61e866d08f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_dog_all_of +except ImportError: + child_dog_all_of = sys.modules[ + 'petstore_api.model.child_dog_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_dog import ChildDog + + +class TestChildDog(unittest.TestCase): + """ChildDog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildDog(self): + """Test ChildDog""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildDog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..ca75000c650e3a0b5e97d672e7c68a645d8bfde5 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.child_dog_all_of import ChildDogAllOf + + +class TestChildDogAllOf(unittest.TestCase): + """ChildDogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildDogAllOf(self): + """Test ChildDogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildDogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py new file mode 100644 index 0000000000000000000000000000000000000000..975dc1612a9f484aa2dcbda3146a164ad709b094 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_lizard_all_of +except ImportError: + child_lizard_all_of = sys.modules[ + 'petstore_api.model.child_lizard_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_lizard import ChildLizard + + +class TestChildLizard(unittest.TestCase): + """ChildLizard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildLizard(self): + """Test ChildLizard""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildLizard() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..1b3bf4dba943bf2b7a5d627404d9574fe6511aa1 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.child_lizard_all_of import ChildLizardAllOf + + +class TestChildLizardAllOf(unittest.TestCase): + """ChildLizardAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChildLizardAllOf(self): + """Test ChildLizardAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildLizardAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py new file mode 100644 index 0000000000000000000000000000000000000000..060df39e4b5ee6f9797908bb6545b4f04f0c4a69 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.class_model import ClassModel + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_client.py new file mode 100644 index 0000000000000000000000000000000000000000..ab5e3a80d3778febe44181c15c041cb328784b96 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_client.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.client import Client + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py new file mode 100644 index 0000000000000000000000000000000000000000..9fb96ebc6b92260b0306cc5a874ce57bb8f43dc4 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import dog_all_of +except ImportError: + dog_all_of = sys.modules[ + 'petstore_api.model.dog_all_of'] +from petstore_api.model.dog import Dog + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog + This will fail because additional_properties_type is None in Animal and it must be defined as any type + to allow in the property breed which is not defined in Animal, it is defined in Dog + """ + # make an instance of dog, a composed schema model + class_name = 'Dog' + color = 'white' + breed = 'Jack Russel Terrier' + with self.assertRaises(petstore_api.exceptions.ApiValueError): + dog = Dog( + class_name=class_name, + color=color, + breed=breed + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..7ab4e8ae79d8ad4df6d2a948a5b6183dff6d0806 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.dog_all_of import DogAllOf + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py new file mode 100644 index 0000000000000000000000000000000000000000..64ad5fd7dc08f13443817629721aefb15d28d95e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.enum_arrays import EnumArrays + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_enumarrays_init(self): + # + # Check various combinations of valid values. + # + fish_or_crab = EnumArrays(just_symbol=">=") + self.assertEqual(fish_or_crab.just_symbol, ">=") + # if optional property is unset we raise an exception + with self.assertRaises(petstore_api.ApiAttributeError) as exc: + self.assertEqual(fish_or_crab.array_enum, None) + + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + + # + # Check if setting invalid values fails + # + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab = EnumArrays(just_symbol="<=") + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"]) + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"]) + + + def test_enumarrays_setter(self): + + # + # Check various combinations of valid values + # + fish_or_crab = EnumArrays() + + fish_or_crab.just_symbol = ">=" + self.assertEqual(fish_or_crab.just_symbol, ">=") + + fish_or_crab.just_symbol = "$" + self.assertEqual(fish_or_crab.just_symbol, "$") + + fish_or_crab.array_enum = [] + self.assertEqual(fish_or_crab.array_enum, []) + + fish_or_crab.array_enum = ["fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab.array_enum = ["fish", "fish", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) + + fish_or_crab.array_enum = ["crab"] + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + fish_or_crab.array_enum = ["crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) + + fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) + + # + # Check if setting invalid values fails + # + fish_or_crab = EnumArrays() + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.just_symbol = "!=" + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab.just_symbol = ["fish"] + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.array_enum = ["cat"] + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.array_enum = ["fish", "crab", "dog"] + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab.array_enum = "fish" + + + def test_todict(self): + # + # Check if dictionary serialization works + # + dollar_fish_crab_dict = { + 'just_symbol': "$", + 'array_enum': ["fish", "crab"] + } + + dollar_fish_crab = EnumArrays( + just_symbol="$", array_enum=["fish", "crab"]) + + self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) + + # + # Sanity check for different arrays + # + dollar_crab_fish_dict = { + 'just_symbol': "$", + 'array_enum': ["crab", "fish"] + } + + dollar_fish_crab = EnumArrays( + just_symbol="$", array_enum=["fish", "crab"]) + + self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) + + + def test_equals(self): + # + # Check if object comparison works + # + fish1 = EnumArrays(just_symbol="$", array_enum=["fish"]) + fish2 = EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish1, fish2) + + fish = EnumArrays(just_symbol="$", array_enum=["fish"]) + crab = EnumArrays(just_symbol="$", array_enum=["crab"]) + self.assertNotEqual(fish, crab) + + dollar = EnumArrays(just_symbol="$") + greater = EnumArrays(just_symbol=">=") + self.assertNotEqual(dollar, greater) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py new file mode 100644 index 0000000000000000000000000000000000000000..f910231c9d0256a48a0ee31d2a952d2c7191f8f8 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.enum_class import EnumClass + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py new file mode 100644 index 0000000000000000000000000000000000000000..7b4c1b6b66ac80422771b321365abd62a64be794 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import string_enum +except ImportError: + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] +from petstore_api.model.enum_test import EnumTest + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py new file mode 100644 index 0000000000000000000000000000000000000000..34d207f3c71daf5da82bd8facf5a9d05ee8dd93f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_xml_item(self): + """Test case for create_xml_item + + creates an XmlItem # noqa: E501 + """ + pass + + def test_boolean(self): + """Test case for boolean + + """ + endpoint = self.api.boolean + assert endpoint.openapi_types['body'] == (bool,) + assert endpoint.settings['response_type'] == (bool,) + + def test_string(self): + """Test case for string + + """ + endpoint = self.api.string + assert endpoint.openapi_types['body'] == (str,) + assert endpoint.settings['response_type'] == (str,) + + def test_object_model_with_ref_props(self): + """Test case for object_model_with_ref_props + + """ + from petstore_api.model import object_model_with_ref_props + endpoint = self.api.object_model_with_ref_props + assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + + def test_string_enum(self): + """Test case for string_enum + + """ + from petstore_api.model import string_enum + endpoint = self.api.string_enum + assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) + assert endpoint.settings['response_type'] == (string_enum.StringEnum,) + + def test_array_model(self): + """Test case for array_model + + """ + from petstore_api.model import animal_farm + endpoint = self.api.array_model + assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) + assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) + + def test_number_with_validations(self): + """Test case for number_with_validations + + """ + from petstore_api.model import number_with_validations + endpoint = self.api.number_with_validations + assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) + assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) + + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_enums_length_one(self): + """Test case for test_endpoint_enums_length_one + + """ + # when we omit the required enums of length one, they are still set + endpoint = self.api.test_endpoint_enums_length_one + import six + if six.PY3: + from unittest.mock import patch + else: + from mock import patch + with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: + endpoint() + call_with_http_info.assert_called_with( + _check_input_type=True, + _check_return_type=True, + _host_index=None, + _preload_content=True, + _request_timeout=None, + _return_http_data_only=True, + async_req=False, + header_number=1.234, + path_integer=34, + path_string='hello', + query_integer=3, + query_string='brillig' + ) + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íЏ # noqa: E501 + """ + # check that we can access the endpoint's validations + endpoint = self.api.test_endpoint_parameters + assert endpoint.validations[('number',)] == { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + } + # make sure that an exception is thrown on an invalid value + keyword_args = dict( + number=544, # invalid + double=100, + pattern_without_delimiter="abc", + byte='sample string' + ) + with self.assertRaises(petstore_api.ApiValueError): + self.api.test_endpoint_parameters(**keyword_args) + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + # check that we can access the endpoint's allowed_values + endpoint = self.api.test_enum_parameters + assert endpoint.allowed_values[('enum_query_string',)] == { + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + } + # make sure that an exception is thrown on an invalid value + keyword_args = dict(enum_query_string="bad value") + with self.assertRaises(petstore_api.ApiValueError): + self.api.test_enum_parameters(**keyword_args) + + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py new file mode 100644 index 0000000000000000000000000000000000000000..1ade31405a624bac2086659b27f472d3b39da36a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file.py new file mode 100644 index 0000000000000000000000000000000000000000..8d60f64e01cce98ea4b7c4aa47e45c7d6e9ff5b3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.file import File + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFile(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py new file mode 100644 index 0000000000000000000000000000000000000000..9a4f6d38dfef2294815b2607e69abb663872df79 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import file +except ImportError: + file = sys.modules[ + 'petstore_api.model.file'] +from petstore_api.model.file_schema_test_class import FileSchemaTestClass + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ca37b005fd96023fe4f03969e8c337ca628816b2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.format_test import FormatTest + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + import datetime + self.required_named_args = dict( + number=40.1, + byte='what', + date=datetime.date(2019, 3, 23), + password='rainbowtable' + ) + + def test_integer(self): + var_name = 'integer' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_int32(self): + var_name = 'int32' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_number(self): + var_name = 'number' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_float(self): + var_name = 'float' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_double(self): + var_name = 'double' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_password(self): + var_name = 'password' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('max_length', 1), ('min_length', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = 'a'*(validations[key] + adder) + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = 'a'*validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + 'a'*validations[key]) + + def test_string(self): + var_name = 'string' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + values_invalid = ['abc3', '1', '.', ' ', 'Ù…Ø±ØØ¨Ø§', ''] + for value_invalid in values_invalid: + # invalid values throw exceptions + with self.assertRaises(petstore_api.ApiValueError): + keyword_args[var_name] = value_invalid + FormatTest(**keyword_args) + + # valid value works + value_valid = 'abcdz' + keyword_args[var_name] = value_valid + assert getattr(FormatTest(**keyword_args), var_name) == value_valid + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py new file mode 100644 index 0000000000000000000000000000000000000000..2972d01161cd212807931e8e7d30eda9d7d2d309 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.grandparent import Grandparent + + +class TestGrandparent(unittest.TestCase): + """Grandparent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGrandparent(self): + """Test Grandparent""" + # FIXME: construct object with mandatory attributes with example values + # model = Grandparent() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py new file mode 100644 index 0000000000000000000000000000000000000000..cabe4d81f98e6a75154c94e8842de52afacd8fac --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import child_dog +except ImportError: + child_dog = sys.modules[ + 'petstore_api.model.child_dog'] +try: + from petstore_api.model import child_lizard +except ImportError: + child_lizard = sys.modules[ + 'petstore_api.model.child_lizard'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.grandparent_animal import GrandparentAnimal + + +class TestGrandparentAnimal(unittest.TestCase): + """GrandparentAnimal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGrandparentAnimal(self): + """Test GrandparentAnimal""" + # FIXME: construct object with mandatory attributes with example values + # model = GrandparentAnimal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py new file mode 100644 index 0000000000000000000000000000000000000000..9ebd7683b398344d3874189b1db6f2897b5cfd26 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.has_only_read_only import HasOnlyReadOnly + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_list.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_list.py new file mode 100644 index 0000000000000000000000000000000000000000..52156adfed2e2c89378e78541929cbff6d097d08 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_list.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.list import List + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py new file mode 100644 index 0000000000000000000000000000000000000000..3feda0f688dfa419c68763fb6ad1c4b96a07cdc3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import string_boolean_map +except ImportError: + string_boolean_map = sys.modules[ + 'petstore_api.model.string_boolean_map'] +from petstore_api.model.map_test import MapTest + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_maptest_init(self): + # + # Test MapTest construction with valid values + # + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test = MapTest(map_of_enum_string=up_or_low_dict) + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + map_of_map_of_strings = { + 'valueDict': up_or_low_dict + } + map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings) + + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + + # + # Make sure that the init fails for invalid enum values + # + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + with self.assertRaises(petstore_api.ApiValueError): + MapTest(map_of_enum_string=black_or_white_dict) + + def test_maptest_setter(self): + # + # Check with some valid values + # + map_enum_test = MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test.map_of_enum_string = up_or_low_dict + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + # + # Check if the setter fails for invalid enum values + # + map_enum_test = MapTest() + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + with self.assertRaises(petstore_api.ApiValueError): + map_enum_test.map_of_enum_string = black_or_white_dict + + def test_todict(self): + # + # Check dictionary serialization + # + map_enum_test = MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_of_map_of_strings = { + 'valueDict': up_or_low_dict + } + indirect_map = string_boolean_map.StringBooleanMap(**{ + 'option1': True + }) + direct_map = { + 'option2': False + } + map_enum_test.map_of_enum_string = up_or_low_dict + map_enum_test.map_map_of_string = map_of_map_of_strings + map_enum_test.indirect_map = indirect_map + map_enum_test.direct_map = direct_map + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + self.assertEqual(map_enum_test.indirect_map, indirect_map) + self.assertEqual(map_enum_test.direct_map, direct_map) + + expected_dict = { + 'map_of_enum_string': up_or_low_dict, + 'map_map_of_string': map_of_map_of_strings, + 'indirect_map': indirect_map.to_dict(), + 'direct_map': direct_map + } + + self.assertEqual(map_enum_test.to_dict(), expected_dict) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 0000000000000000000000000000000000000000..4dcb5ad4268ce7a6f99fba5fd72eef7c9296ba44 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..4012eaae3362a6987f136736fa4e3422a16311b4 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.model200_response import Model200Response + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py new file mode 100644 index 0000000000000000000000000000000000000000..54c98b33cd6608e37b793a7dbcae822cb1f21207 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.model_return import ModelReturn + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_name.py new file mode 100644 index 0000000000000000000000000000000000000000..6a9be99d1a57222cda1a3375aaefeaf9a8d17920 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_name.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.name import Name + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py new file mode 100644 index 0000000000000000000000000000000000000000..07aab1d78af7c4dec24f4ec99d6a6b0122390675 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.number_only import NumberOnly + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py new file mode 100644 index 0000000000000000000000000000000000000000..3f0b78835d4be9ef977e7f1000001edb8b43407f --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberWithValidations(self): + """Test NumberWithValidations""" + valid_values = [10.0, 15.0, 20.0] + for valid_value in valid_values: + model = NumberWithValidations(valid_value) + assert model.value == valid_value + + invalid_values = [9.0, 21.0] + for invalid_value in invalid_values: + with self.assertRaises(petstore_api.ApiValueError): + NumberWithValidations(invalid_value) + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py new file mode 100644 index 0000000000000000000000000000000000000000..35bd3b6d8ec7d2c4b02cf221f7c47e25acc1fc92 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + from petstore_api.model.number_with_validations import NumberWithValidations + self.assertEqual( + ObjectModelWithRefProps.openapi_types, + { + 'my_number': (NumberWithValidations,), + 'my_string': (str,), + 'my_boolean': (bool,), + } + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_order.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_order.py new file mode 100644 index 0000000000000000000000000000000000000000..ee6988e28ccd9dd48001f8680be41b1f851a0702 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_order.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.order import Order + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + order = Order() + order.status = "placed" + self.assertEqual("placed", order.status) + with self.assertRaises(petstore_api.ApiValueError): + order.status = "invalid" + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py new file mode 100644 index 0000000000000000000000000000000000000000..20282dfb41ea1af15db7950c7d962cf81e0acff2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import grandparent +except ImportError: + grandparent = sys.modules[ + 'petstore_api.model.grandparent'] +try: + from petstore_api.model import parent_all_of +except ImportError: + parent_all_of = sys.modules[ + 'petstore_api.model.parent_all_of'] +from petstore_api.model.parent import Parent + + +class TestParent(unittest.TestCase): + """Parent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testParent(self): + """Test Parent""" + # FIXME: construct object with mandatory attributes with example values + # model = Parent() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py new file mode 100644 index 0000000000000000000000000000000000000000..ca87189bba50276abcb02c4b4b6812ed485e85c7 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.parent_all_of import ParentAllOf + + +class TestParentAllOf(unittest.TestCase): + """ParentAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testParentAllOf(self): + """Test ParentAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ParentAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py new file mode 100644 index 0000000000000000000000000000000000000000..17a4d60e75dcb614f3374f74dad79606b1484070 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import child_dog +except ImportError: + child_dog = sys.modules[ + 'petstore_api.model.child_dog'] +try: + from petstore_api.model import child_lizard +except ImportError: + child_lizard = sys.modules[ + 'petstore_api.model.child_lizard'] +try: + from petstore_api.model import grandparent_animal +except ImportError: + grandparent_animal = sys.modules[ + 'petstore_api.model.grandparent_animal'] +from petstore_api.model.parent_pet import ParentPet + + +class TestParentPet(unittest.TestCase): + """ParentPet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testParentPet(self): + """Test ParentPet""" + # FIXME: construct object with mandatory attributes with example values + # model = ParentPet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py new file mode 100644 index 0000000000000000000000000000000000000000..b072cff5e9adfa0876cdcf3d938822231ff5b4a9 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import category +except ImportError: + category = sys.modules[ + 'petstore_api.model.category'] +try: + from petstore_api.models import tag +except ImportError: + tag = sys.modules[ + 'petstore_api.model.tag'] +from petstore_api.model.pet import Pet + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_to_str(self): + pet = Pet(name="test name", photo_urls=["string"]) + pet.id = 1 + pet.status = "available" + cate = category.Category() + cate.id = 1 + cate.name = "dog" + pet.category = cate + tag1 = tag.Tag() + tag1.id = 1 + pet.tags = [tag1] + + data = ("{'category': {'id': 1, 'name': 'dog'},\n" + " 'id': 1,\n" + " 'name': 'test name',\n" + " 'photo_urls': ['string'],\n" + " 'status': 'available',\n" + " 'tags': [{'id': 1}]}") + self.assertEqual(data, pet.to_str()) + + def test_equal(self): + pet1 = Pet(name="test name", photo_urls=["string"]) + pet1.id = 1 + pet1.status = "available" + cate1 = category.Category() + cate1.id = 1 + cate1.name = "dog" + tag1 = tag.Tag() + tag1.id = 1 + pet1.tags = [tag1] + + pet2 = Pet(name="test name", photo_urls=["string"]) + pet2.id = 1 + pet2.status = "available" + cate2 = category.Category() + cate2.id = 1 + cate2.name = "dog" + tag2 = tag.Tag() + tag2.id = 1 + pet2.tags = [tag2] + + self.assertTrue(pet1 == pet2) + + # reset pet1 tags to empty array so that object comparison returns false + pet1.tags = [] + self.assertFalse(pet1 == pet2) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py new file mode 100644 index 0000000000000000000000000000000000000000..091b30cf8ac0e71ad75d88cbb29b4069b114173a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_player.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_player.py new file mode 100644 index 0000000000000000000000000000000000000000..ee7b95a677f1a1593cbb306891ffde8e7a7634de --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_player.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.player import Player + + +class TestPlayer(unittest.TestCase): + """Player unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPlayer(self): + """Test Player""" + # we can make a player without an enemy_player property + jane = Player(name="Jane") + # we can make a player with an enemy_player + sally = Player(name="Sally", enemy_player=jane) + # we can make a player with an inline enemy_player + jim = Player( + name="Jim", + enemy_player=Player(name="Sam") + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py new file mode 100644 index 0000000000000000000000000000000000000000..c2dcde240e77bb43bfc23fd6ce3dde21ba0a1101 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.read_only_first import ReadOnlyFirst + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py new file mode 100644 index 0000000000000000000000000000000000000000..6124525f5170cda7376404df7f4a4f73af130b41 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.special_model_name import SpecialModelName + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py new file mode 100644 index 0000000000000000000000000000000000000000..0d9cc3dd36eabc358423c6c9ed8c13bb9454e564 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py new file mode 100644 index 0000000000000000000000000000000000000000..e2e9d8b420b8d404c696c1f811d280dbfa237877 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.string_boolean_map import StringBooleanMap + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py new file mode 100644 index 0000000000000000000000000000000000000000..5eed0ad6f0e9be2ec19bc664a87d6db1fa56d041 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.string_enum import StringEnum + + +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringEnum(self): + """Test StringEnum""" + + """Test OuterEnum""" + # make sure that we can access its allowed_values + assert StringEnum.allowed_values[('value',)] == { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered" + } + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + StringEnum('bad_value') + # make sure valid value works + valid_value = StringEnum.allowed_values[('value',)]['PLACED'] + assert valid_value == StringEnum(valid_value).value + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py new file mode 100644 index 0000000000000000000000000000000000000000..68a3b9046bf42a9727bce4fd09b9320ee5a1646a --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.tag import Tag + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py new file mode 100644 index 0000000000000000000000000000000000000000..f9c050b81a8273b34d40f1de9c8520cf83065cbf --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.type_holder_default import TypeHolderDefault + + +class TestTypeHolderDefault(unittest.TestCase): + """TypeHolderDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTypeHolderDefault(self): + """Test TypeHolderDefault""" + # required_vars are set to None now until swagger-parser/swagger-core fixes + # https://github.com/swagger-api/swagger-parser/issues/971 + array_item = [1, 2, 3] + model = TypeHolderDefault(array_item=array_item) + self.assertEqual(model.string_item, 'what') + self.assertEqual(model.bool_item, True) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py new file mode 100644 index 0000000000000000000000000000000000000000..e1ee7c368628c624a51aec5a52c81c2df8938261 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.type_holder_example import TypeHolderExample + + +class TestTypeHolderExample(unittest.TestCase): + """TypeHolderExample unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTypeHolderExample(self): + """Test TypeHolderExample""" + # FIXME: construct object with mandatory attributes with example values + # model = TypeHolderExample() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user.py new file mode 100644 index 0000000000000000000000000000000000000000..7241bb589c524d32928a1fa1ff32b074c3d1dc27 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.user import User + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py new file mode 100644 index 0000000000000000000000000000000000000000..df306da07761c0f7bccafa6d5e52234657d92c4e --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py new file mode 100644 index 0000000000000000000000000000000000000000..4354664815fffc5c1839c364fb91f9b1b1757838 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.xml_item import XmlItem + + +class TestXmlItem(unittest.TestCase): + """XmlItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testXmlItem(self): + """Test XmlItem""" + # FIXME: construct object with mandatory attributes with example values + # model = XmlItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh new file mode 100644 index 0000000000000000000000000000000000000000..6f5e2c41d3a67fcdf1ac4ebb22fd41d6cc9b6d51 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT + +### run tests +tox || exit 1 + +### static analysis of code +#flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3a386a21026f9b15b2c303a81f5c69333e9056 Binary files /dev/null and b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png differ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3a386a21026f9b15b2c303a81f5c69333e9056 Binary files /dev/null and b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png differ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b12cf5927ac757b054dd875ee137c2581f69bb Binary files /dev/null and b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png differ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..c249bf1fc5e8396b9613afe2d0366c47cb27eaa3 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import os +import time +import atexit +import weakref +import unittest +from dateutil.parser import parse + +import petstore_api +import petstore_api.configuration + +HOST = 'http://petstore.swagger.io/v2' + + +class ApiClientTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = 'PREFIX' + config.username = 'test_username' + config.password = 'test_password' + + header_params = {'test1': 'value1'} + query_params = {'test2': 'value2'} + auth_settings = ['api_key', 'unknown'] + + client = petstore_api.ApiClient(config) + + # test prefix + self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) + + # test api key auth + self.assertEqual(header_params['test1'], 'value1') + self.assertEqual(header_params['api_key'], 'PREFIX 123456') + self.assertEqual(query_params['test2'], 'value2') + + # test basic auth + self.assertEqual('test_username', client.configuration.username) + self.assertEqual('test_password', client.configuration.password) + + # test api key without prefix + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = None + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) + self.assertEqual(header_params['api_key'], '123456') + + # test api key with empty prefix + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = '' + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) + self.assertEqual(header_params['api_key'], '123456') + + # test api key with prefix specified in the api_key, useful when the prefix + # must include '=' sign followed by the API key secret without space. + config.api_key['api_key'] = 'PREFIX=123456' + config.api_key_prefix['api_key'] = None + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) + self.assertEqual(header_params['api_key'], 'PREFIX=123456') + + + def test_select_header_accept(self): + accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/json', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/xml', 'application/json'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['text/plain', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'text/plain, application/xml') + + accepts = [] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, None) + + def test_select_header_content_type(self): + content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/json', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/xml', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['text/plain', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'text/plain') + + content_types = [] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + def test_sanitize_for_serialization(self): + # None + data = None + result = self.api_client.sanitize_for_serialization(None) + self.assertEqual(result, data) + + # str + data = "test string" + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # int + data = 1 + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # bool + data = True + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # date + data = parse("1997-07-16").date() # date + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16") + + # datetime + data = parse("1997-07-16T19:20:30.45+01:00") # datetime + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + + # list + data = [1] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # dict + data = {"test key": "test value"} + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # model + pet_dict = {"id": 1, "name": "monkey", + "category": {"id": 1, "name": "test category"}, + "tags": [{"id": 1, "fullName": "test tag1"}, + {"id": 2, "fullName": "test tag2"}], + "status": "available", + "photoUrls": ["http://foo.bar.com/3", + "http://foo.bar.com/4"]} + from petstore_api.model.pet import Pet + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + from petstore_api.model.string_boolean_map import StringBooleanMap + pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + pet.id = pet_dict["id"] + cate = Category() + cate.id = pet_dict["category"]["id"] + cate.name = pet_dict["category"]["name"] + pet.category = cate + tag1 = Tag() + tag1.id = pet_dict["tags"][0]["id"] + tag1.full_name = pet_dict["tags"][0]["fullName"] + tag2 = Tag() + tag2.id = pet_dict["tags"][1]["id"] + tag2.full_name = pet_dict["tags"][1]["fullName"] + pet.tags = [tag1, tag2] + pet.status = pet_dict["status"] + + data = pet + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, pet_dict) + + # list of models + list_of_pet_dict = [pet_dict] + data = [pet] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, list_of_pet_dict) + + # model with additional proerties + model_dict = {'some_key': True} + model = StringBooleanMap(**model_dict) + result = self.api_client.sanitize_for_serialization(model) + self.assertEqual(result, model_dict) + + def test_context_manager_closes_threadpool(self): + with petstore_api.ApiClient() as client: + self.assertIsNotNone(client.pool) + pool_ref = weakref.ref(client._pool) + self.assertIsNotNone(pool_ref()) + self.assertIsNone(pool_ref()) + + def test_atexit_closes_threadpool(self): + client = petstore_api.ApiClient() + self.assertIsNotNone(client.pool) + self.assertIsNotNone(client._pool) + atexit._run_exitfuncs() + self.assertIsNone(client._pool) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py new file mode 100644 index 0000000000000000000000000000000000000000..0d0771b578509efb17727bd8453adca3f9135918 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import six +import sys +import unittest + +import petstore_api + +from .util import id_gen + +class ApiExceptionTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + from petstore_api.api.pet_api import PetApi + self.pet_api = PetApi(self.api_client) + self.setUpModels() + + def setUpModels(self): + from petstore_api.model import category, tag, pet + self.category = category.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = tag.Tag() + self.tag.id = id_gen() + self.tag.full_name = "blank" + self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def test_404_error(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id) + + with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"): + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + except petstore_api.ApiException as e: + self.assertEqual(e.status, 404) + self.assertEqual(e.reason, "Not Found") + self.checkRegex(e.body, "Pet not found") + + def test_500_error(self): + self.pet_api.add_pet(self.pet) + + with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"): + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special" + ) + + try: + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special" + ) + except petstore_api.ApiException as e: + self.assertEqual(e.status, 500) + self.assertEqual(e.reason, "Internal Server Error") + self.checkRegex(e.body, "Error 500 Internal Server Error") + + def checkRaiseRegex(self, expected_exception, expected_regex): + if sys.version_info < (3, 0): + return self.assertRaisesRegexp(expected_exception, expected_regex) + + return self.assertRaisesRegex(expected_exception, expected_regex) + + def checkRegex(self, text, expected_regex): + if sys.version_info < (3, 0): + return self.assertRegexpMatches(text, expected_regex) + + return self.assertRegex(text, expected_regex) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py new file mode 100644 index 0000000000000000000000000000000000000000..92903bb232ddff31cba411f7c4cfcbf61432b3a2 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py @@ -0,0 +1,442 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIPetstore-python +$ nosetests -v +""" +from collections import namedtuple +import json +import os +import time +import unittest +import datetime + +import six + +import petstore_api + +from petstore_api.exceptions import ( + ApiTypeError, + ApiKeyError, + ApiValueError, +) +from petstore_api.model import ( + enum_test, + pet, + animal, + dog, + parent_pet, + child_lizard, + category, + string_enum, + number_with_validations, + string_boolean_map, +) +from petstore_api.model_utils import ( + file_type, + model_to_dict, +) + +from petstore_api.rest import RESTResponse + +MockResponse = namedtuple('MockResponse', 'data') + +class DeserializationTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.deserialize = self.api_client.deserialize + + def test_enum_test(self): + """ deserialize dict(str, Enum_Test) """ + data = { + 'enum_test': { + "enum_string": "UPPER", + "enum_string_required": "lower", + "enum_integer": 1, + "enum_number": 1.1, + "stringEnum": "placed" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, + ({str: (enum_test.EnumTest,)},), True) + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue( + isinstance(deserialized['enum_test'], enum_test.EnumTest)) + value = ( + string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) + string_enum_val = string_enum.StringEnum(value) + sample_instance = enum_test.EnumTest( + enum_string="UPPER", + enum_string_required="lower", + enum_integer=1, + enum_number=1.1, + string_enum=string_enum_val + ) + self.assertEqual(deserialized['enum_test'], sample_instance) + + def test_deserialize_dict_str_pet(self): + """ deserialize dict(str, Pet) """ + data = { + 'pet': { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "fullName": "string" + } + ], + "status": "available" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, + ({str: (pet.Pet,)},), True) + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['pet'], pet.Pet)) + + def test_deserialize_dict_str_dog(self): + """ deserialize dict(str, Dog), use discriminator + This will fail because additional_properties_type is None in Animal and it must be defined as any type + to allow in the property breed which is not defined in Animal, it is defined in Dog + """ + with self.assertRaises(petstore_api.exceptions.ApiValueError): + data = { + 'dog': { + "className": "Dog", + "color": "white", + "breed": "Jack Russel Terrier" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, + ({str: (animal.Animal,)},), True) + + def test_deserialize_lizard(self): + """ deserialize ChildLizard, use discriminator + because additional_properties_type is None in ChildLizardAllOf + we are unable to use the discriminator + For this to work correctly, additional_properties_type must allow in any type + Then in ChildLizardAllOf defines the property pet_type and allows in lovesRocks as an additionalProperty + """ + with self.assertRaises(petstore_api.exceptions.ApiValueError): + data = { + "pet_type": "ChildLizard", + "lovesRocks": True + } + response = MockResponse(data=json.dumps(data)) + + lizard = self.deserialize(response, + (parent_pet.ParentPet,), True) + + def test_deserialize_dict_str_int(self): + """ deserialize dict(str, int) """ + data = { + 'integer': 1 + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, ({str: (int,)},), True) + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['integer'], int)) + + def test_deserialize_str(self): + """ deserialize str """ + data = "test str" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (str,), True) + self.assertTrue(isinstance(deserialized, str)) + + def test_deserialize_date(self): + """ deserialize date """ + data = "1997-07-16" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (datetime.date,), True) + self.assertTrue(isinstance(deserialized, datetime.date)) + + def test_deserialize_datetime(self): + """ deserialize datetime """ + data = "1997-07-16T19:20:30.45+01:00" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (datetime.datetime,), True) + self.assertTrue(isinstance(deserialized, datetime.datetime)) + + def test_deserialize_pet(self): + """ deserialize pet """ + data = { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "fullName": "string" + } + ], + "status": "available" + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (pet.Pet,), True) + self.assertTrue(isinstance(deserialized, pet.Pet)) + self.assertEqual(deserialized.id, 0) + self.assertEqual(deserialized.name, "doggie") + self.assertTrue(isinstance(deserialized.category, category.Category)) + self.assertEqual(deserialized.category.name, "string") + self.assertTrue(isinstance(deserialized.tags, list)) + self.assertEqual(deserialized.tags[0].full_name, "string") + + def test_deserialize_list_of_pet(self): + """ deserialize list[Pet] """ + data = [ + { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie0", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "fullName": "string" + } + ], + "status": "available" + }, + { + "id": 1, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie1", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "fullName": "string" + } + ], + "status": "available" + }] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, + ([pet.Pet],), True) + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], pet.Pet)) + self.assertEqual(deserialized[0].id, 0) + self.assertEqual(deserialized[1].id, 1) + self.assertEqual(deserialized[0].name, "doggie0") + self.assertEqual(deserialized[1].name, "doggie1") + + def test_deserialize_nested_dict(self): + """ deserialize dict(str, dict(str, int)) """ + data = { + "foo": { + "bar": 1 + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, + ({str: ({str: (int,)},)},), True) + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized["foo"], dict)) + self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) + + def test_deserialize_nested_list(self): + """ deserialize list[list[str]] """ + data = [["foo"]] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, ([[str]],), True) + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], list)) + self.assertTrue(isinstance(deserialized[0][0], str)) + + def test_deserialize_none(self): + """ deserialize None """ + response = MockResponse(data=json.dumps(None)) + + error_msg = ( + "Invalid type for variable 'received_data'. Required value type is " + "datetime and passed type was NoneType at ['received_data']" + ) + with self.assertRaises(ApiTypeError) as exc: + deserialized = self.deserialize(response, (datetime.datetime,), True) + self.assertEqual(str(exc.exception), error_msg) + + def test_deserialize_OuterEnum(self): + """ deserialize OuterEnum """ + # make sure that an exception is thrown on an invalid value + with self.assertRaises(ApiValueError): + self.deserialize( + MockResponse(data=json.dumps("test str")), + (string_enum.StringEnum,), + True + ) + + # valid value works + placed_str = ( + string_enum.StringEnum.allowed_values[('value',)]["PLACED"] + ) + response = MockResponse(data=json.dumps(placed_str)) + deserialized = self.deserialize(response, + (string_enum.StringEnum,), True) + self.assertTrue(isinstance(deserialized, string_enum.StringEnum)) + self.assertTrue(deserialized.value == placed_str) + + def test_deserialize_NumberWithValidations(self): + """ deserialize NumberWithValidations """ + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(ApiTypeError): + deserialized = self.deserialize( + MockResponse(data=json.dumps("test str")), + (number_with_validations.NumberWithValidations,), + True + ) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(ApiValueError): + deserialized = self.deserialize( + MockResponse(data=json.dumps(21.0)), + (number_with_validations.NumberWithValidations,), + True + ) + + # valid value works + number_val = 11.0 + response = MockResponse(data=json.dumps(number_val)) + number = self.deserialize(response, + (number_with_validations.NumberWithValidations,), True) + self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) + self.assertTrue(number.value == number_val) + + def test_deserialize_file(self): + """Ensures that file deserialization works""" + response_types_mixed = (file_type,) + + # sample from http://www.jtricks.com/download-text + HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] + ) + headers = {'Content-Disposition': 'attachment; filename=content.txt'} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + file_data = ( + "You are reading text file that was supposed to be downloaded\r\n" + "to your hard disk. If your browser offered to save you the file," + "\r\nthen it handled the Content-Disposition header correctly." + ) + http_response = HTTPResponse( + status=200, + reason='OK', + data=file_data, + getheaders=get_headers, + getheader=get_header + ) + # response which is deserialized to a file + mock_response = RESTResponse(http_response) + file_path = None + try: + file_object = self.deserialize( + mock_response, response_types_mixed, True) + self.assertTrue(isinstance(file_object, file_type)) + file_path = file_object.name + self.assertFalse(file_object.closed) + file_object.close() + if six.PY3: + file_data = file_data.encode('utf-8') + with open(file_path, 'rb') as other_file_object: + self.assertEqual(other_file_object.read(), file_data) + finally: + os.unlink(file_path) + + def test_deserialize_binary_to_str(self): + """Ensures that bytes deserialization works""" + response_types_mixed = (str,) + + # sample from http://www.jtricks.com/download-text + HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] + ) + headers = {} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + data = "str" + + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), + getheaders=get_headers, + getheader=get_header + ) + + mock_response = RESTResponse(http_response) + + result = self.deserialize(mock_response, response_types_mixed, True) + self.assertEqual(isinstance(result, str), True) + self.assertEqual(result, data) + + def test_deserialize_string_boolean_map(self): + """ + Ensures that string boolean (additional properties) + deserialization works + """ + # make sure that an exception is thrown on an invalid type + with self.assertRaises(ApiTypeError): + deserialized = self.deserialize( + MockResponse(data=json.dumps("test str")), + (string_boolean_map.StringBooleanMap,), + True + ) + + # valid value works + item_val = {'some_key': True} + response = MockResponse(data=json.dumps(item_val)) + model = string_boolean_map.StringBooleanMap(**item_val) + deserialized = self.deserialize(response, + (string_boolean_map.StringBooleanMap,), True) + self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap)) + self.assertTrue(deserialized['some_key'] == True) + self.assertTrue(deserialized == model) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py new file mode 100644 index 0000000000000000000000000000000000000000..38d7a1cc0b82efabfd5b33cb3dc32887eddc4bc6 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py @@ -0,0 +1,406 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +from collections import namedtuple +import json +import os +import unittest + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ( + RESTClientObject, + RESTResponse +) + +import six + +from petstore_api.exceptions import ( + ApiException, + ApiValueError, + ApiTypeError, +) +from petstore_api.api.pet_api import PetApi +from petstore_api.model import pet +from .util import id_gen + +import urllib3 + +if six.PY3: + from unittest.mock import patch +else: + from mock import patch + +HOST = 'http://localhost/v2' + + +class TimeoutWithEqual(urllib3.Timeout): + def __init__(self, *arg, **kwargs): + super(TimeoutWithEqual, self).__init__(*arg, **kwargs) + + def __eq__(self, other): + return self._read == other._read and self._connect == other._connect and self.total == other.total + + +class MockPoolManager(object): + def __init__(self, tc): + self._tc = tc + self._reqs = [] + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + def request(self, *args, **kwargs): + self._tc.assertTrue(len(self._reqs) > 0) + r = self._reqs.pop(0) + self._tc.maxDiff = None + self._tc.assertEqual(r[0], args) + self._tc.assertEqual(r[1], kwargs) + return urllib3.HTTPResponse(status=200, body=b'test') + + +class PetApiTests(unittest.TestCase): + + def setUp(self): + config = Configuration() + config.host = HOST + config.access_token = 'ACCESS_TOKEN' + self.api_client = petstore_api.ApiClient(config) + self.pet_api = PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + from petstore_api.model import category, tag + self.category = category.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = tag.Tag() + self.tag.id = id_gen() + self.tag.name = "python-pet-tag" + self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + + def test_preload_content_flag(self): + self.pet_api.add_pet(self.pet) + + resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) + + # return response should at least have read and close methods. + self.assertTrue(hasattr(resp, 'read')) + self.assertTrue(hasattr(resp, 'close')) + + # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. + self.assertTrue(hasattr(resp, 'release_conn')) + + # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking + # change, however supporting above methods should be enough for most usecases. Remove this test case if + # we followed the breaking change procedure for python client (e.g. increasing major version). + self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') + + resp.close() + resp.release_conn() + + def test_config(self): + config = Configuration(host=HOST) + self.assertIsNotNone(config.get_host_settings()) + self.assertEqual(config.get_basic_auth_token(), + urllib3.util.make_headers(basic_auth=":").get('authorization')) + # No authentication scheme has been configured at this point, so auth_settings() + # should return an empty list. + self.assertEqual(len(config.auth_settings()), 0) + # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters. + config.access_token = 'MY-ACCESS_TOKEN' + self.assertEqual(len(config.auth_settings()), 1) + self.assertIn("petstore_auth", config.auth_settings().keys()) + config.username = "user" + config.password = "password" + self.assertEqual( + config.get_basic_auth_token(), + urllib3.util.make_headers(basic_auth="user:password").get('authorization')) + self.assertEqual(len(config.auth_settings()), 2) + self.assertIn("petstore_auth", config.auth_settings().keys()) + self.assertIn("http_basic_test", config.auth_settings().keys()) + config.username = None + config.password = None + self.assertEqual(len(config.auth_settings()), 1) + self.assertIn("petstore_auth", config.auth_settings().keys()) + + def test_timeout(self): + mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ACCESS_TOKEN', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(total=5)) + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ACCESS_TOKEN', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + + self.pet_api.add_pet(self.pet, _request_timeout=5) + self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + + def test_separate_default_client_instances(self): + pet_api = PetApi() + pet_api2 = PetApi() + self.assertNotEqual(pet_api.api_client, pet_api2.api_client) + + pet_api.api_client.user_agent = 'api client 3' + pet_api2.api_client.user_agent = 'api client 4' + + self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) + + def test_separate_default_config_instances(self): + pet_api = PetApi() + pet_api2 = PetApi() + self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) + + pet_api.api_client.configuration.host = 'somehost' + pet_api2.api_client.configuration.host = 'someotherhost' + self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + + def test_async_request(self): + thread = self.pet_api.add_pet(self.pet, async_req=True) + response = thread.get() + self.assertIsNone(response) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + result = thread.get() + self.assertIsInstance(result, pet.Pet) + + def test_async_with_result(self): + self.pet_api.add_pet(self.pet, async_req=False) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + + response = thread.get() + response2 = thread2.get() + + self.assertEqual(response.id, self.pet.id) + self.assertIsNotNone(response2.id, self.pet.id) + + def test_async_with_http_info(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True, + _return_http_data_only=False) + data, status, headers = thread.get() + + self.assertIsInstance(data, pet.Pet) + self.assertEqual(status, 200) + + def test_async_exception(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id(-9999999999999, async_req=True) + + exception = None + try: + thread.get() + except ApiException as e: + exception = e + + self.assertIsInstance(exception, ApiException) + self.assertEqual(exception.status, 404) + + def test_add_pet_and_get_pet_by_id(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertIsNotNone(fetched.category) + self.assertEqual(self.pet.category.name, fetched.category.name) + + def test_add_pet_and_get_pet_by_id_with_http_info(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id( + pet_id=self.pet.id, + _return_http_data_only=False + ) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + + def test_update_pet(self): + self.pet.name = "hello kity with updated" + self.pet_api.update_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + self.assertIsNotNone(fetched.category) + self.assertEqual(fetched.category.name, self.pet.category.name) + + def test_find_pets_by_status(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) + ) + + def test_find_pets_by_tags(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) + ) + + def test_update_pet_with_form(self): + self.pet_api.add_pet(self.pet) + + name = "hello kity with form updated" + status = "pending" + self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(name, fetched.name) + self.assertEqual(status, fetched.status) + + def test_upload_file(self): + # upload file with form parameter + file_path1 = os.path.join(self.test_file_dir, "1px_pic1.png") + file_path2 = os.path.join(self.test_file_dir, "1px_pic2.png") + try: + file = open(file_path1, "rb") + additional_metadata = "special" + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata=additional_metadata, + file=file + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file.close() + + # upload only one file + try: + file = open(file_path1, "rb") + self.pet_api.upload_file(pet_id=self.pet.id, file=file) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file.close() + + # upload multiple files + HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] + ) + headers = {} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + api_respponse = { + 'code': 200, + 'type': 'blah', + 'message': 'file upload succeeded' + } + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(api_respponse).encode('utf-8'), + getheaders=get_headers, + getheader=get_header + ) + mock_response = RESTResponse(http_response) + try: + file1 = open(file_path1, "rb") + file2 = open(file_path2, "rb") + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = mock_response + res = self.pet_api.upload_file( + pet_id=684696917, files=[file1, file2]) + mock_method.assert_called_with( + 'POST', + 'http://localhost/v2/pet/684696917/uploadImage', + _preload_content=True, + _request_timeout=None, + body=None, + headers={ + 'Accept': 'application/json', + 'Content-Type': 'multipart/form-data', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python', + 'Authorization': 'Bearer ACCESS_TOKEN' + }, + post_params=[ + ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), + ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) + ], + query_params=[] + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + file2.close() + + # passing in an array of files to when file only allows one + # raises an exceptions + try: + file = open(file_path1, "rb") + with self.assertRaises(ApiTypeError) as exc: + self.pet_api.upload_file(pet_id=self.pet.id, file=[file]) + finally: + file.close() + + # passing in a single file when an array of file is required + # raises an exception + try: + file = open(file_path1, "rb") + with self.assertRaises(ApiTypeError) as exc: + self.pet_api.upload_file(pet_id=self.pet.id, files=file) + finally: + file.close() + + # passing in a closed file raises an exception + with self.assertRaises(ApiValueError) as exc: + file = open(file_path1, "rb") + file.close() + self.pet_api.upload_file(pet_id=self.pet.id, file=file) + + + def test_delete_pet(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + raise Exception("expected an error") + except ApiException as e: + self.assertEqual(404, e.status) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py new file mode 100644 index 0000000000000000000000000000000000000000..1f718ecca6b51f1bf173ab7b67d56a01f845c563 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIPetstore-python +$ nosetests -v +""" +from collections import namedtuple +import json +import os +import time +import unittest +import datetime + +import six + +import petstore_api + +from petstore_api.exceptions import ( + ApiTypeError, + ApiKeyError, + ApiValueError, +) +from petstore_api.model import ( + enum_test, + pet, + animal, + dog, + parent_pet, + child_lizard, + category, + string_enum, + string_boolean_map, +) +from petstore_api.model_utils import ( + file_type, + model_to_dict, +) + +from petstore_api.rest import RESTResponse + +MockResponse = namedtuple('MockResponse', 'data') + +class SerializationTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.serialize = self.api_client.sanitize_for_serialization + + def test_enum_test(self): + """ serialize dict(str, Enum_Test) """ + value = ( + string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) + string_enum_val = string_enum.StringEnum(value) + + source = enum_test.EnumTest( + enum_string="UPPER", + enum_string_required="lower", + enum_integer=1, + enum_number=1.1, + string_enum=string_enum_val + ) + + result = { + 'enum_test': { + "enum_string": "UPPER", + "enum_string_required": "lower", + "enum_integer": 1, + "enum_number": 1.1, + "stringEnum": "placed" + } + } + serialized = self.serialize({"enum_test": source}) + + self.assertEqual(result, serialized) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py new file mode 100644 index 0000000000000000000000000000000000000000..a7c1d5dd6670c8e8c16b4c817af9f9161abaf279 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAP/Petstore-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi + + +class StoreApiTests(unittest.TestCase): + + def setUp(self): + self.store_api = StoreApi() + + def tearDown(self): + # sleep 1 sec between two every 2 tests + time.sleep(1) + + def test_get_inventory(self): + data = self.store_api.get_inventory() + self.assertIsNotNone(data) + self.assertTrue(isinstance(data, dict)) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/util.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/util.py new file mode 100644 index 0000000000000000000000000000000000000000..113d7dcc54786a7a70508512fba7e6407aa8e737 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tox.ini b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..8989fc3c4d96de4ff8aebb8182dbbbe28647b082 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=petstore_api diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 750c4b903ccb57d4b1ebeee43eb3b9fcc539929c..2634c4d132ece459c127af51291cec7410e43262 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index ce4ac8abfb031455c8810c596f57e9bbe8b196a1..6145ff7431c0c5ee44bca2ef2d9c318d66f98b88 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index 0cac8c1d547cd609b78fb891104f1b060d1fadfb..9d3dc978d094014ac765ed72f58c4984fb97127d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 703f5be95bca603ba84f6422dfd02588480679a9..2155182abf54808eec523f1ac2f35403ed14c51e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index bfd8f5f7d7afa03267b6b436709b701a2fd170d1..fd68ab477734f421c9c40b3b72c51f624584fc4f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index aa43ca8995aff8eeef2538efc76683ac28c5f49e..4754887194d115b6a66b801382834c7dbc27d2b5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index c0485eb645f116c0cd2dcd635b4c00b0bc683d71..3851c7b2ab6ff512df093b9e6b606f069a0b2315 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 8ea4b4b0e9763553be23d8c3b196e8391ec237eb..73bca582e269ae6f7afb8671cea7814273e0bb91 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 598c32af2cda18dc0334a68fbd1235bb2a0f4b49..c50394c22f26424fb6a6a21ecca85d7562862e29 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 1d38fc1aca0038d03d957ca4ea4d97bdb4da7090..124c188d8d8d9814b9c0e9ab23aa7b088b3d96dd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 1de0fcf41e4b901014bbca3441644d9a725e546b..9b2851dfaa088f06130052a11db75e3dfb9cb752 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 8b98afa53b4274a80ab088d4a315471cb63d4880..01b2eb58d7f34838ecf6a304c6bde99c37f00fa5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 1a7dc7d3ed24ba4b561b2d239de877084036600d..8e737d582c8460bd3f51841477fb13b755cd9b37 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 1bc05a75bbd096335318cee6e8a3b3db2cdb1cd3..2bbfba46c3f093803e40548d599057ad330a98fc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 755de673b0712b590b7423236d9eb259e22e3f1d..057c5b787b60123fda2b5593c0cf6c6c0bade05d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index be18224cb871418c9ad3b3a8c63ebfdc7454e0ba..9585dd80a6ba7d4c172f6493aa81b87355cc6a20 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 15f80037208946b986912b5efaa52e43757562a9..583ea424607cc66d77c117591a4a275781969d6e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index f36ec2ebde41e4c9fd4a3cfdca8f4ab411a5fd13..0d698fee60fd246ba4f7034d174ad7f5169759f8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 1f5c40a46a76fa8a40e9815011ebc9cb44f91a29..984aee85a0848f7adef1bbcc9a4c572c4aac11cd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index a0c998e55b4cd33a4908f19c664bde8716d2a43b..cca5e6828b35fb9c59490977e42b84680c677a14 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index fa15320508a8e7000f94a564f7fdaf712dc5b65d..3bdce1b83f3a26d7d81e56010a35eabea624b95a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index f97739dde24a730509ed0b1c8b6abe3385d7995d..d185566668f13bde55c4714bf2e858d4209cc709 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index de38da9d83547e70cabedd3c204c0d244bc40d70..7f6d0947223d17b9021aca002837f98ba8ab98fa 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index ed52da3e9bda64831800c4aed999b7b81573fab0..9874575bd0bba473256ae7cb14ed094024577ac6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 5e12984f12331011c2f09450a6ac22db719db777..62839a7cb13199b6d5f863125da9ebbb0c38eaac 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 6ffd8325e87d2a69dbedb18b04993384a6991259..e281d2ddc469382bf7b11f9f3b21ff2dc1d8e8f1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 0e611fe2698aee9c1c91a2c2d2e36227341c21d2..6c44023fb2b27bd3474d380297d1fc0b6737f0f1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index daf17b6cde4c26f343e287f88206041a011d908a..d3416f495acfb8627dbf58e2f66504b2652fac84 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index c5b378b1153a75ee1403f5205d10d12972d6c2fc..76ee9955810528b165979e18551a63cec1dbd79d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 5d9ddb6ad317209aa954bf26b2f1c33781d002ce..c07f1a43ea08c783e51207b556d125b30df941c3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index a1d50615e29be5997732ab7e0b5a70f3229361b0..54eb0760f5e88b4e56f568f36565b5e3c19133dd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index ee5e962dab5d91dceec14842afb3b32179f99278..0c57d78ac252e8c212870369b2f9841159dcf9bd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index de132288ac76af3275174374aa1a36d6d8ba5017..3fe1977ba7d33f228e8b8ed746188ff20b3efba6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 07dac1b3702a46d862cb2442b5e84e82db9c4fcb..aebfc27084e602a3942952ae96e81fb229069ed9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index d2db203c92e23e62eadd3ae1f46ad56345b7745c..2eb6b88a2242b68c4a9b248f2402af48ed711b99 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 09cddbfab59a748ebe95c19ef0f0ffd32e202332..f04fceff81b6878ba542ab237933e0fa3874c276 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 251717f5ac72f8f71cdc6e8f1bee5d6672c6f3c4..552d9ae330acd41a4cd9c6166835217b16915358 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 44cb070f17240a27490263de6c3f008d0e4c6861..bf90d3cd06f7369a906320e9746f4decdb603a54 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index bbaf3e60bfd507099a8442ab8fa413c9e34d950e..bad3bfcce3a37125d330bb900fde6bd8b85eda5b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 9da6725291ccffe317508bf99e1e63ff6d411f47..d33b1bf1dac42f21bca489154059651acb120c6a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 50dd9118530d69a8fe727d764b8d1cf1d6df2114..6a1777a426daede06cb40d61818a959bc0ccb08d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index 10c24d4031efce403bbeb49094e468ece5cad3c0..3d0d81a74442e1cc0b23c0f755ccdb16237a2a31 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 200e60e7e77db57326bdef2407b182043c30e0e4..7359f1b1115b58a8a5813370115b477e44387c90 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index a1bff1b538a52bc2966d00263113a289b95f5491..6778c4b97fb38aea5485f7f44baa052ecc6964b0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index b1ce3365bbc8f49b7f560e8b70a232210a21b991..b6d4bd88ace77c4094585351dddcd5cb16b73f65 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index 039001bac65d1e69309aef9eb9d9b1c9ba5deda0..92a7aac382b7407aad751d2bb1b69c793f029567 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 67ac727cfc3e2a69d60c5e792382539ca448a995..7097f7d9fb95bc818e0362530ebd3ef80e06f82c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index 6a8eb37afcaebe46ae7c4bfa5d987435353562e6..30c26017cc75ff898c9cdeb09a722bbcb1a74ad6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 3b92319f0a9ae72f192307cb11e14600f230c4b5..a95eab63a6ee09ed2dfefcd39235be7c6de7add2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb index 03c36edddf96c51fc6cd5532cbb84d050c85421d..6950269d997148dd49379f8e4b65143d4f2b4c22 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 446b3a2b77c89d231898f1f1e27c52109a6f9a16..c810bf54845f39768f674152ca7273fa377dcd3f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 15d4a7eb39a6de8bb4fa72db62bed148c8f62ece..53774ce12d44806b375e811b5ea9a2d9a7a4a828 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 7c19a2802e33796d57f06b2a37395c5746a6e242..06d53c68ff09d5181efdc2c56d6844cad199e33e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index a6231b218d5e89c1d4e59a8888530d5cf0dda872..b9a14f579744ff6c730eb4ebed00a1359416c94a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 1753e0fdc6225b42b78c8e6af3c7cd0591a935c0..c1f7816f475b97b9e6ec4d87264feb3a5c971fbc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index e3af89cab0ae98bf183b66d01112489f7264ea0b..ab3b0dfefbde3e3d8541d512940e9209f34bb467 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index c20498913670fa9746e4445eb8f9e8d42ef6f47f..06a7eb1a52c16e8c8158b6cc4f1ef40230c05709 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index 6636d136dc243c19140d77dd5706c4b65fabcfba..05a5580fd4d11919f883b2d88b8ab0c0468e85a3 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index e74a5700c11170e46b6f0cfa12b60c89c54b1895..10c9510b23981be6b46b5604f784e4a54e96ac45 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index 10b289fbb9c19c29d33259ebdc0c774db71caf58..86d92cda2b9f712f18915fa08d9ee2ce2bc029f3 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 750c4b903ccb57d4b1ebeee43eb3b9fcc539929c..2634c4d132ece459c127af51291cec7410e43262 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index ce4ac8abfb031455c8810c596f57e9bbe8b196a1..6145ff7431c0c5ee44bca2ef2d9c318d66f98b88 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index 0cac8c1d547cd609b78fb891104f1b060d1fadfb..9d3dc978d094014ac765ed72f58c4984fb97127d 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 703f5be95bca603ba84f6422dfd02588480679a9..2155182abf54808eec523f1ac2f35403ed14c51e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index bfd8f5f7d7afa03267b6b436709b701a2fd170d1..fd68ab477734f421c9c40b3b72c51f624584fc4f 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 5d3469816c6b8b9da9e888a8781a969dc337f22a..13b4b66578da58de907c06cda0480270ec4b4046 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 410fc39481a6f4647cc55f53a2bb0df1eac1b5a0..df456319b41b3f66216544532fb52c44b2d6f434 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index b8ed9d8a55cc5d2a1d376ae3e1b91ffa2f75e571..879e9eb4ad6a9dbc4107c4211138891b785e9b43 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index df219df025a633bc1afdbe0fe4f9c3931fdee4ca..3a1bf4bd35d3e87ac57faa4fd111ed4d6dc05a3e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 1d38fc1aca0038d03d957ca4ea4d97bdb4da7090..124c188d8d8d9814b9c0e9ab23aa7b088b3d96dd 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index ba6011b27cc7dd33ac5f81f0c327df68eeb6d281..cc5e1929d674064d63b4fed4904251c1b5c867c3 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 8b98afa53b4274a80ab088d4a315471cb63d4880..01b2eb58d7f34838ecf6a304c6bde99c37f00fa5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 1a7dc7d3ed24ba4b561b2d239de877084036600d..8e737d582c8460bd3f51841477fb13b755cd9b37 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 1bc05a75bbd096335318cee6e8a3b3db2cdb1cd3..2bbfba46c3f093803e40548d599057ad330a98fc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 755de673b0712b590b7423236d9eb259e22e3f1d..057c5b787b60123fda2b5593c0cf6c6c0bade05d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index be18224cb871418c9ad3b3a8c63ebfdc7454e0ba..9585dd80a6ba7d4c172f6493aa81b87355cc6a20 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 15f80037208946b986912b5efaa52e43757562a9..583ea424607cc66d77c117591a4a275781969d6e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index f36ec2ebde41e4c9fd4a3cfdca8f4ab411a5fd13..0d698fee60fd246ba4f7034d174ad7f5169759f8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 1f5c40a46a76fa8a40e9815011ebc9cb44f91a29..984aee85a0848f7adef1bbcc9a4c572c4aac11cd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index a0c998e55b4cd33a4908f19c664bde8716d2a43b..cca5e6828b35fb9c59490977e42b84680c677a14 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index fa15320508a8e7000f94a564f7fdaf712dc5b65d..3bdce1b83f3a26d7d81e56010a35eabea624b95a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index f97739dde24a730509ed0b1c8b6abe3385d7995d..d185566668f13bde55c4714bf2e858d4209cc709 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index de38da9d83547e70cabedd3c204c0d244bc40d70..7f6d0947223d17b9021aca002837f98ba8ab98fa 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index ed52da3e9bda64831800c4aed999b7b81573fab0..9874575bd0bba473256ae7cb14ed094024577ac6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 5e12984f12331011c2f09450a6ac22db719db777..62839a7cb13199b6d5f863125da9ebbb0c38eaac 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 6ffd8325e87d2a69dbedb18b04993384a6991259..e281d2ddc469382bf7b11f9f3b21ff2dc1d8e8f1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 0e611fe2698aee9c1c91a2c2d2e36227341c21d2..6c44023fb2b27bd3474d380297d1fc0b6737f0f1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index daf17b6cde4c26f343e287f88206041a011d908a..d3416f495acfb8627dbf58e2f66504b2652fac84 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index c5b378b1153a75ee1403f5205d10d12972d6c2fc..76ee9955810528b165979e18551a63cec1dbd79d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 5d9ddb6ad317209aa954bf26b2f1c33781d002ce..c07f1a43ea08c783e51207b556d125b30df941c3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index a1d50615e29be5997732ab7e0b5a70f3229361b0..54eb0760f5e88b4e56f568f36565b5e3c19133dd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index ee5e962dab5d91dceec14842afb3b32179f99278..0c57d78ac252e8c212870369b2f9841159dcf9bd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index de132288ac76af3275174374aa1a36d6d8ba5017..3fe1977ba7d33f228e8b8ed746188ff20b3efba6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 07dac1b3702a46d862cb2442b5e84e82db9c4fcb..aebfc27084e602a3942952ae96e81fb229069ed9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index d2db203c92e23e62eadd3ae1f46ad56345b7745c..2eb6b88a2242b68c4a9b248f2402af48ed711b99 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 09cddbfab59a748ebe95c19ef0f0ffd32e202332..f04fceff81b6878ba542ab237933e0fa3874c276 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 251717f5ac72f8f71cdc6e8f1bee5d6672c6f3c4..552d9ae330acd41a4cd9c6166835217b16915358 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 44cb070f17240a27490263de6c3f008d0e4c6861..bf90d3cd06f7369a906320e9746f4decdb603a54 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index bbaf3e60bfd507099a8442ab8fa413c9e34d950e..bad3bfcce3a37125d330bb900fde6bd8b85eda5b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 9da6725291ccffe317508bf99e1e63ff6d411f47..d33b1bf1dac42f21bca489154059651acb120c6a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 50dd9118530d69a8fe727d764b8d1cf1d6df2114..6a1777a426daede06cb40d61818a959bc0ccb08d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index 10c24d4031efce403bbeb49094e468ece5cad3c0..3d0d81a74442e1cc0b23c0f755ccdb16237a2a31 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 200e60e7e77db57326bdef2407b182043c30e0e4..7359f1b1115b58a8a5813370115b477e44387c90 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index a1bff1b538a52bc2966d00263113a289b95f5491..6778c4b97fb38aea5485f7f44baa052ecc6964b0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index b1ce3365bbc8f49b7f560e8b70a232210a21b991..b6d4bd88ace77c4094585351dddcd5cb16b73f65 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 039001bac65d1e69309aef9eb9d9b1c9ba5deda0..92a7aac382b7407aad751d2bb1b69c793f029567 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 67ac727cfc3e2a69d60c5e792382539ca448a995..7097f7d9fb95bc818e0362530ebd3ef80e06f82c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index 6a8eb37afcaebe46ae7c4bfa5d987435353562e6..30c26017cc75ff898c9cdeb09a722bbcb1a74ad6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 3b92319f0a9ae72f192307cb11e14600f230c4b5..a95eab63a6ee09ed2dfefcd39235be7c6de7add2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb index 03c36edddf96c51fc6cd5532cbb84d050c85421d..6950269d997148dd49379f8e4b65143d4f2b4c22 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 446b3a2b77c89d231898f1f1e27c52109a6f9a16..c810bf54845f39768f674152ca7273fa377dcd3f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 15d4a7eb39a6de8bb4fa72db62bed148c8f62ece..53774ce12d44806b375e811b5ea9a2d9a7a4a828 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 7c19a2802e33796d57f06b2a37395c5746a6e242..06d53c68ff09d5181efdc2c56d6844cad199e33e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index a6231b218d5e89c1d4e59a8888530d5cf0dda872..b9a14f579744ff6c730eb4ebed00a1359416c94a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 1753e0fdc6225b42b78c8e6af3c7cd0591a935c0..c1f7816f475b97b9e6ec4d87264feb3a5c971fbc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index e3af89cab0ae98bf183b66d01112489f7264ea0b..ab3b0dfefbde3e3d8541d512940e9209f34bb467 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index ba5010c9ad30c1c42821c3112e34b0a14a1caf62..fca963ec152cf8218d1cb8eb1a411a474409af85 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 84ddda3cd2fa1a50150156289436bad74169ed93..663b8081006c4f11e614c46800422a45477271ca 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index e74a5700c11170e46b6f0cfa12b60c89c54b1895..10c9510b23981be6b46b5604f784e4a54e96ac45 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 10b289fbb9c19c29d33259ebdc0c774db71caf58..86d92cda2b9f712f18915fa08d9ee2ce2bc029f3 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f7833547f177a6fe200ed83a0dc2cb494f1dba6e..6dc5d09f0c8ad6dc3a7a591104ccddedebed45b1 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 68f629dced828d587fd46cd64997a891a4d77deb..0c181e59ee37a1f89ce4d484495a586ef01c32dc 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2c98b5f9e6e7039966c93320abaa7db743b17951..f62f460d1213e2824973ab242a1d5d725f59e674 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/spring-cloud-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 index d1844b1b80eb85df2923696caa013dd2921d4576..f77fdf21de245b6f70490ef9aed6fb3cb5e1fb7f 100644 --- 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 index 3d5a391e7566bf7fda3c6a22efc10a8691e37049..241a82690b1ef08c69bc789e6cd7ba0b305fac58 100644 --- 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 index 2c49c9711a01e9df39732384b8ca7af77bd51a8c..ad21d7b810591715c99b24731b3191ed710fed00 100644 --- 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 25b9d6c7bbfe9dec4bf337ded05674553b42fc9a..8b6ead39e2c7a62803fa8de352f98c79f6e9043f 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 cc73031ff47072f1e5df93f210b73bb75297b3e0..83d5530deb7916a33abb4a748df7971cd82ac6ac 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 82598e85da9e0e635f5e22f4c19f90918b9615c5..683cff0ce64bac7cc69174a663b63f23a3e54433 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 d1844b1b80eb85df2923696caa013dd2921d4576..f77fdf21de245b6f70490ef9aed6fb3cb5e1fb7f 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3d5a391e7566bf7fda3c6a22efc10a8691e37049..241a82690b1ef08c69bc789e6cd7ba0b305fac58 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2c49c9711a01e9df39732384b8ca7af77bd51a8c..ad21d7b810591715c99b24731b3191ed710fed00 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 e1326d3c1565d2affca3122be9f16546c6141179..08660cdaac365959fc5c8e1903ba0d16ed32fef7 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 be1f97295c4bacbdbfd6c1ca6f580cf1af683895..229a0ba4240aa0a1281ab1ef13365c46bf5d327f 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 c17e07317f18617ec7e1f29f420aa0651ec6f469..e2d924590ee8e685c01ca22b8dcbfabd7c516efa 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 0d580d8d1e437a749548e7c4170a1f499de46d4d..3132601fc90cc586c59270f37e648fd1f1e2776c 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <openapi-generator-version>5.1.1</openapi-generator-version> + <openapi-generator-version>5.2.0-SNAPSHOT</openapi-generator-version> <maven-plugin-version>1.0.0</maven-plugin-version> <junit-version>4.8.1</junit-version> </properties> diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/elm/.openapi-generator/VERSION b/samples/openapi3/client/elm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/elm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py index 55b99827e5e73e9e1389fe6c131d6a5a01bd85f9..9345e736905d30230da82c2760a815cfb7fb338e 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py @@ -434,27 +434,43 @@ class ModelComposed(OpenApiModel): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -464,13 +480,12 @@ class ModelComposed(OpenApiModel): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1584,8 +1599,13 @@ def get_allof_instances(self, model_args, constant_args): self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1593,20 +1613,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1666,31 +1674,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1747,24 +1733,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1777,47 +1747,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1861,36 +1818,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb index 5d62d9e01b7d230873abaa0e5340a17b672b24c5..e0d70e377a4df9c38ab6f100ee611277e2f010e0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index f8ae35b13c2232d02fd72eb3c539c89785cb3201..e150a0f673f346b0d550165082c83aa517c216a5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index 99e9438cb201c2f333e2e4b73b0a7eb299948485..dceb19bdb2232123ff1196797cc2bdac32d04a53 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb index 7369c821c638cbaa145253ffdb0b8502183643ba..3984528e045e3572c21cc18702cdb711e5e4e42f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index fd11558513261340ee0ba6e084ed186680164b8c..65f2cfea56a5465fd233b9f60b2ed4aec085a555 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb index bec887f3ba3bb13a4055a6090df216eabf69e70a..80e58dd211a7fdc52a5572973085ad8e0186df06 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb index 7939be4d57a93aa481cc5e3da0d515e6b3fd1eef..0b4502a11c8bdc91daebc3551a78a502c2ae0edb 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb index 54976687720d8f52eada8627b2b392aff91a7e4c..df8bb818aa767ecfdd4d744d13b822ad0106bdb6 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb index b0ecb1bc2afe9e9fd68fac4703ac70670457366e..ae5d77411e267f2d51b4a777792d88044793dc1a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec index ad8a2136d24807f6946c1dfb041d48a56582b5e1..0b5caba0e8bd56547a3ee0c386273bc7b907a250 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py index fb914b5b8f2f708ea880280d0d8f0f2aa0cf6789..bb9ec1c821a0d3873c5441b2d168e2695e851ec3 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py @@ -434,27 +434,43 @@ class ModelComposed(OpenApiModel): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -464,13 +480,12 @@ class ModelComposed(OpenApiModel): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1584,8 +1599,13 @@ def get_allof_instances(self, model_args, constant_args): self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1593,20 +1613,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1666,31 +1674,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1747,24 +1733,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1777,47 +1747,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1861,36 +1818,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec index 4e4be0666e622ca0edde5b44ed12e9cf56782e43..bfaeacb1aed82f5a03e395d137f91534892b9b1a 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec +++ b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb index 5e12502a252ac6466e7c48dab34675f065686602..2fdd66b4145d8ab79ce5da67cf7fad65ccb4e414 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index a0f3984182533181c8ac6098df1281ec6b5a089d..1fdb9e468f0e4e5ad4bffe796d8bfcff1dfcd181 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index 3c7ba7513404c275e2b9d9dd6572946daed0621a..5e236ccddd9b753a8d054c6ad16d6da6190f89b2 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb index 19c2c33c8d1d9781cdf9ab7ef8f6d02ea11082ac..fbb07fa1c4dc20e09308d65ead9c171a61ed8f90 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index 610ae1ee391f7c54cd84f5f4bb069820ca51f8e4..9ae58b4a33a6f11a34557ec8ab6477db19e3b8d8 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb index 491408695279d41818ccde28487628d25833b8a3..6c7f7ac27d9044212dc46c688301c6aee5e49ed0 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb index f58f4fe7abdd400314507473b8cec18464fdd7e1..685f1ee26c872d81156a4e032476010d617f2ab7 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb index 5b48148980674a77f630bcb9de1d064407034204..adc964496e42dd05e4e2f77fed883621ee308198 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb index 8d86c5fcb464e331112a36abd7bd751e6a6bed0e..68368b2e587ea05069368733eaa70dc008e7176c 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb index 094621b8f13ffa9c5d88e61047d38939f6877d3e..dedc2a733bebb943f68143c10dc08ab53ac46e84 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index 5e7cc93fe24409c5996cf50e8a55641dbe13e1a3..355c78dd797bd72b8dbce6f2c5b8b4392526e736 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index 77737db9da51bd86962f08e2ac1adfa6884b2e43..02e0f300d1095ad454500b89b76b1da8c47a6729 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb index b03431e318d667fc4f942fc142bcce3796aab503..921981794ebb3f4eba82f01b3d1ebb45e7c63c1c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index b060d134d004d98dfac3edd0605d9ef2515f45aa..20bb2cf0269df43bf54b857cf940a7ec5559e917 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb index 40705ae7172ed0a404620c157d43e092b556aa0a..b9f03227ba9940783654f252ab913575e777e0df 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb index 45a136dfc17f57fbe6cc67f75cfdbc1882b616f2..6cac74ac13e735bde2e916c90a8aa10645ac871c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb index 6108550a509efe7dbc129528b90c482559ebfa65..787763a66f3bf57e1412692e1dc95f436ef42cd1 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec index 9f5fc1189588a4ccf68b168dddbd291b6db9b88f..af450c8fe8df2b2bc48e54d1a0ae9f162cc00ff5 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb index de0ecf55bbb028867fbaa1c0810b879e182bf3b4..495e376a0946489e46dbeed1b5f35aa9c26be95e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb index 31ffae2b67d19789772af855fea702749d1b282c..55ca88de58b44a98422b7443e68513d7f99916a1 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb index 4b6f23b312a6de7929bcf76c676d084a95cb36dd..9ab6dba6ba0cec1a7da3413eb6c09ed8dc091b60 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.1 +OpenAPI Generator version: 5.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/native/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/native/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.coverage b/samples/openapi3/client/petstore/python-experimental/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..9e8563e13450422ac584dd73f6572a2d6b14b7cf Binary files /dev/null and b/samples/openapi3/client/petstore/python-experimental/.coverage differ diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/pom.xml b/samples/openapi3/client/petstore/python-legacy/pom.xml index 98955483eb8f0a3ca12690516dcdf57ce1a6d970..3a9cf727306597b28d3d588e7d79ba41a0f06975 100755 --- a/samples/openapi3/client/petstore/python-legacy/pom.xml +++ b/samples/openapi3/client/petstore/python-legacy/pom.xml @@ -1,7 +1,7 @@ <project> <modelVersion>4.0.0</modelVersion> <groupId>org.openapitools</groupId> - <artifactId>PythonOAS3PetstoreTests</artifactId> + <artifactId>PythonLegacyOAS3PetstoreTests</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <name>Python OpenAPI3 Petstore Client</name> diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index e3b9c0feabbe71ab2ef3530bddb90fffc2916e68..175fdaa0919609cbbad95a16cb34cccecd9510b9 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -28,6 +28,7 @@ docs/ClassModel.md docs/Client.md docs/ComplexQuadrilateral.md docs/ComposedOneOfNumberWithValidations.md +docs/ComposedSchemaWithPropsAndNoAddProps.md docs/DanishPig.md docs/DefaultApi.md docs/Dog.md @@ -139,6 +140,7 @@ petstore_api/model/class_model.py petstore_api/model/client.py petstore_api/model/complex_quadrilateral.py petstore_api/model/composed_one_of_number_with_validations.py +petstore_api/model/composed_schema_with_props_and_no_add_props.py petstore_api/model/danish_pig.py petstore_api/model/dog.py petstore_api/model/dog_all_of.py diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 2fc4c6b58bd280bb54a934e1e2eb8f5a21d1233c..ce718fd4a46832866104af2da157bed8e33fd46e 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -159,6 +159,7 @@ Class | Method | HTTP request | Description - [Client](docs/Client.md) - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) + - [ComposedSchemaWithPropsAndNoAddProps](docs/ComposedSchemaWithPropsAndNoAddProps.md) - [DanishPig](docs/DanishPig.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md index 460813c1223170582a0c0cb6b7dcf70ff34d5f85..b8d54e3c9bf14c2a91d15df9eb5b5746c942f4e7 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -10,8 +10,9 @@ Name | Type | Description | Notes **map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] **map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] **map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**empty_map** | **bool, date, datetime, dict, float, int, list, str** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**empty_map** | **dict** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] **map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md index 49ca7b3d754052ea476890af84bba7d26b7b5f8c..5cdb2f4c9221a3504fa39f063601154b6248718d 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**any string name** | **[EnumClass]** | any string name can be used but the value must be the correct type | [optional] +**any string name** | [**[EnumClass]**](EnumClass.md) | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python/docs/Animal.md index 1d1c77c01abc4cb048828b44b4ececc8d677d565..d36c66a5d88213a28a981aabfb05211f9269fad1 100644 --- a/samples/openapi3/client/petstore/python/docs/Animal.md +++ b/samples/openapi3/client/petstore/python/docs/Animal.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | **color** | **str** | | [optional] if omitted the server will use the default value of "red" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python/docs/AnimalFarm.md index fc299cf27d342d3499915b0438134d7c16952cfb..fb3b33c9c9c2448a240c2e987e36640e8d05ea3e 100644 --- a/samples/openapi3/client/petstore/python/docs/AnimalFarm.md +++ b/samples/openapi3/client/petstore/python/docs/AnimalFarm.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[Animal]**](Animal.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ApiResponse.md b/samples/openapi3/client/petstore/python/docs/ApiResponse.md index 81a7d0d85227718256a4a53ca8bcbc2096d2f1c8..bedefea9a9cb7b372afbd2c03d71346304243fc2 100644 --- a/samples/openapi3/client/petstore/python/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/python/docs/ApiResponse.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **code** | **int** | | [optional] **type** | **str** | | [optional] **message** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Apple.md b/samples/openapi3/client/petstore/python/docs/Apple.md index d8ba5ec0711bebbd3c3bd5d0c7817ca2c6882f1c..d7634278906b977ba55e48bb1cbc054c6af0411a 100644 --- a/samples/openapi3/client/petstore/python/docs/Apple.md +++ b/samples/openapi3/client/petstore/python/docs/Apple.md @@ -4,8 +4,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cultivar** | **str** | | [optional] +**cultivar** | **str** | | **origin** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md index 6ab77963788b2634f2b3b1af7455e14488b9a063..11cd25c98ee4f41cb0b80ef2b8a662b0cfb29350 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_array_number** | **[[float]]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md index d2f8ea80a3d964fc0af0c3d2975849eb1308787e..f1593c10afd0ea92f812059f560db89c8e6ce8b3 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[StringEnum]**](StringEnum.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md index ebc65a54ba7ef0b656134ccb1aee1cd4b377638b..1e9bb12e4e8bf1c400d76be15e0409e494539677 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_number** | **[float]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayTest.md b/samples/openapi3/client/petstore/python/docs/ArrayTest.md index 4e1bda8fc3af5d206578dc1c8325b5ab63b86731..9eac1f8874c4c2905084e9b203011d6555ff6849 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayTest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] **array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Banana.md b/samples/openapi3/client/petstore/python/docs/Banana.md index 54e06a1de596e9aa039698bf1d0c848e5a730aa5..2e38614e0f8361d264eed21b7320c520bc0d0640 100644 --- a/samples/openapi3/client/petstore/python/docs/Banana.md +++ b/samples/openapi3/client/petstore/python/docs/Banana.md @@ -4,7 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**length_cm** | **float** | | [optional] +**length_cm** | **float** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/BasquePig.md b/samples/openapi3/client/petstore/python/docs/BasquePig.md index 6c583c5bc9f58d6da696197f09e528956598bf78..0d92ecbe02bbe670c6ef05b68e8e1f18c601446f 100644 --- a/samples/openapi3/client/petstore/python/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python/docs/BasquePig.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Capitalization.md b/samples/openapi3/client/petstore/python/docs/Capitalization.md index 1ddeadeb3f463ba78caacd3c75a820ad59ff5fc2..df9989f8db579d0be0621799644f09024bec9d59 100644 --- a/samples/openapi3/client/petstore/python/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python/docs/Capitalization.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **capital_snake** | **str** | | [optional] **sca_eth_flow_points** | **str** | | [optional] **att_name** | **str** | Name of the pet | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/CatAllOf.md b/samples/openapi3/client/petstore/python/docs/CatAllOf.md index 0ff7809a99ac07c46854b47e3ebdd750dbc7ab8f..6fd1390a749bb822e1254238497d23b250a25d10 100644 --- a/samples/openapi3/client/petstore/python/docs/CatAllOf.md +++ b/samples/openapi3/client/petstore/python/docs/CatAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **declawed** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python/docs/Category.md index 940f6a45e6418f84e5483d84264b461b4dc3306a..7650eccafba5691b7701e2af3fda16c9b8ff1a56 100644 --- a/samples/openapi3/client/petstore/python/docs/Category.md +++ b/samples/openapi3/client/petstore/python/docs/Category.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | defaults to "default-name" **id** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md index c5883b9a87c80c063d04bb4bf33345c6024b4a70..c5b2f58f28ceea2a606d1dc72e387edfa38700a9 100644 --- a/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md +++ b/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ClassModel.md b/samples/openapi3/client/petstore/python/docs/ClassModel.md index 48ed7cbf2ff0c35fd1e04db8a094eb2fdeddf1f9..6605a16d74a9f3877b71a4166f0b9f182f08be1c 100644 --- a/samples/openapi3/client/petstore/python/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python/docs/ClassModel.md @@ -6,6 +6,7 @@ Model for testing model with \"_class\" property Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_class** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Client.md b/samples/openapi3/client/petstore/python/docs/Client.md index c3986008d6c37dcb94e62691067f468b8b196e6f..1b293140f3487262baccaae6ec26c86646fb230c 100644 --- a/samples/openapi3/client/petstore/python/docs/Client.md +++ b/samples/openapi3/client/petstore/python/docs/Client.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ComposedSchemaWithPropsAndNoAddProps.md b/samples/openapi3/client/petstore/python/docs/ComposedSchemaWithPropsAndNoAddProps.md new file mode 100644 index 0000000000000000000000000000000000000000..5930b762b0c222c9c68d8af7c4ee7cfd99d4ca2d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/ComposedSchemaWithPropsAndNoAddProps.md @@ -0,0 +1,13 @@ +# ComposedSchemaWithPropsAndNoAddProps + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **str** | | [optional] +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/DanishPig.md b/samples/openapi3/client/petstore/python/docs/DanishPig.md index dd7fe16ea4a9dd1013cdf6941718d8b14a5fd668..4d1ebe4f68a0f6dec733a7856803fa0d488ed886 100644 --- a/samples/openapi3/client/petstore/python/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python/docs/DanishPig.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DogAllOf.md b/samples/openapi3/client/petstore/python/docs/DogAllOf.md index 6382bbd80671a878eec0d9ea040d6e9958c25ab6..2907a9fd5c4349b0a95c81e0400713c3636d5bd1 100644 --- a/samples/openapi3/client/petstore/python/docs/DogAllOf.md +++ b/samples/openapi3/client/petstore/python/docs/DogAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **breed** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Drawing.md b/samples/openapi3/client/petstore/python/docs/Drawing.md index 0f0390a3f720db42213884a34b824208ecb88c30..a4fc4830562f5507ef0bd2e33a767c5aa9b55d1f 100644 --- a/samples/openapi3/client/petstore/python/docs/Drawing.md +++ b/samples/openapi3/client/petstore/python/docs/Drawing.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **shape_or_null** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] **nullable_shape** | [**NullableShape**](NullableShape.md) | | [optional] **shapes** | [**[Shape]**](Shape.md) | | [optional] -**any string name** | **Fruit** | any string name can be used but the value must be the correct type | [optional] +**any string name** | [**Fruit**](Fruit.md) | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumArrays.md b/samples/openapi3/client/petstore/python/docs/EnumArrays.md index 9be5c645a8099d2df1275940b7c3ab4f4e8bb72c..ad4e9d2fcb7caf088fa0f43184c57bfbb5012905 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python/docs/EnumArrays.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_symbol** | **str** | | [optional] **array_enum** | **[str]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumClass.md b/samples/openapi3/client/petstore/python/docs/EnumClass.md index a1f9aae5819006fc6b7acd69d196f1e575c97311..39bb0e1644c5016b181209c5d78d5b09a2b0ae5f 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python/docs/EnumClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumTest.md b/samples/openapi3/client/petstore/python/docs/EnumTest.md index b9181858434c2d0530e72e57390d3c5af6e5587a..27b6997e695d3e6857847ee7341a6611eb0db01e 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python/docs/EnumTest.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] **inline_array_of_str_enum** | [**[StringEnum]**](StringEnum.md) | | [optional] **array_of_str_enum** | [**ArrayOfEnums**](ArrayOfEnums.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md b/samples/openapi3/client/petstore/python/docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md index 0ba4e3b8e5a49dd96a837298778143d161fe3d5a..6c3418d8c07975ded426c1e19fb102937ec14878 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md +++ b/samples/openapi3/client/petstore/python/docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **labels** | **[str, none_type]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/File.md b/samples/openapi3/client/petstore/python/docs/File.md index 63b1d1a65186f27d04a99c10a66f7f3d0dde447f..f84547d19331cf3bc4dd6ddad384e8d91c61c37c 100644 --- a/samples/openapi3/client/petstore/python/docs/File.md +++ b/samples/openapi3/client/petstore/python/docs/File.md @@ -6,6 +6,7 @@ Must be named `File` for test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **source_uri** | **str** | Test capitalization | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md index caf2440821daf2c51430b41b1a58ecc049210956..4572aa0905b384502f546dab5deced6c8c7371eb 100644 --- a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **file** | [**File**](File.md) | | [optional] **files** | [**[File]**](File.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python/docs/Foo.md index 23fb5e1678edf1c922385e9278c90a8da1f36c13..c9c54d1ee40a604f1368445f4359ac4d27e44907 100644 --- a/samples/openapi3/client/petstore/python/docs/Foo.md +++ b/samples/openapi3/client/petstore/python/docs/Foo.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **str** | | [optional] if omitted the server will use the default value of "bar" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FormatTest.md b/samples/openapi3/client/petstore/python/docs/FormatTest.md index 4fcec135190fd44aea31285bdfb090d5dba0e86d..3c8cc8697c1cd9500f4a8eea4122691cd415e5d1 100644 --- a/samples/openapi3/client/petstore/python/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python/docs/FormatTest.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **uuid_no_example** | **str** | | [optional] **pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] **pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Fruit.md b/samples/openapi3/client/petstore/python/docs/Fruit.md index 92700e79e0845a35ce6d3d14a957265c2c8b3763..d65f4cb14b4f8de0a29340828a47a4db00c26996 100644 --- a/samples/openapi3/client/petstore/python/docs/Fruit.md +++ b/samples/openapi3/client/petstore/python/docs/Fruit.md @@ -1,13 +1,15 @@ # Fruit +a schema that tests oneOf and includes a schema level property ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**cultivar** | **str** | | +**length_cm** | **float** | | **color** | **str** | | [optional] -**cultivar** | **str** | | [optional] **origin** | **str** | | [optional] -**length_cm** | **float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FruitReq.md b/samples/openapi3/client/petstore/python/docs/FruitReq.md index 7ff54d6ae022721fbecad1b983fa710b697ef3c4..096dde57309100cbee57547c64fbca591f7d79cb 100644 --- a/samples/openapi3/client/petstore/python/docs/FruitReq.md +++ b/samples/openapi3/client/petstore/python/docs/FruitReq.md @@ -1,5 +1,6 @@ # FruitReq +a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas also, this schem accepts null as a value ## Properties Name | Type | Description | Notes @@ -8,6 +9,7 @@ Name | Type | Description | Notes **sweet** | **bool** | | [optional] **cultivar** | **str** | | [optional] **length_cm** | **float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/GmFruit.md b/samples/openapi3/client/petstore/python/docs/GmFruit.md index f2af2abe5cefee5bdfc110f661f71f43d77831de..4da4dd53ad441204dd1ec42c07a6dc3cf9738dea 100644 --- a/samples/openapi3/client/petstore/python/docs/GmFruit.md +++ b/samples/openapi3/client/petstore/python/docs/GmFruit.md @@ -4,10 +4,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**cultivar** | **str** | | +**length_cm** | **float** | | **color** | **str** | | [optional] -**cultivar** | **str** | | [optional] **origin** | **str** | | [optional] -**length_cm** | **float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md index 15db0708bb1aa4d4c6492d04330e06c3a4871325..a1c340378106156ab9be4857b084cfe74a81a0d2 100644 --- a/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md +++ b/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pet_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md index 0e1334519a8b2648cae176dfa8d333ac308c3b6e..88bc03d4ff5c2a5c87940c68931de7b6fd91ba24 100644 --- a/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **str** | | [optional] [readonly] **foo** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md index ab8b660e667f8bb7b21c91d578ae86ac2527e8ca..e20455fb377a23bb5ec20a6db91fcf583b9ff1c5 100644 --- a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md @@ -6,6 +6,7 @@ Just a string to inform instance is up and running. Make it nullable in hope to Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nullable_message** | **str, none_type** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md b/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md index 130320d1daa0c75b2381ca935a295e6ddf8b64a9..5922fc61f1a778f33b98945cfe100655a1984431 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md +++ b/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md @@ -6,6 +6,7 @@ this payload is used for verification that some model_to_dict issues are fixed Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_data** | [**[FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type**](FakeGetInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject6.md b/samples/openapi3/client/petstore/python/docs/InlineObject6.md index 6e4975b3542a306e2b38bbdeff7db665cd5158ea..fc83501c1546693b71dceb019dcb2aff18b8bb53 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineObject6.md +++ b/samples/openapi3/client/petstore/python/docs/InlineObject6.md @@ -6,6 +6,7 @@ this payload is used for verification that some model_to_dict issues are fixed Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_data** | [**[FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type**](FakeGetInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md index f0a52bc4639cb0b597ee658a0df311ad4750586b..b8823d383bac008141bcc761f504e0d4e959ef26 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string** | [**Foo**](Foo.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python/docs/IntegerEnum.md index 9567a76cc2e28eb11739e81a01fd4c11ef81f281..a5b38556bf8c7b125b54310ee7b14abc94a9ed45 100644 --- a/samples/openapi3/client/petstore/python/docs/IntegerEnum.md +++ b/samples/openapi3/client/petstore/python/docs/IntegerEnum.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | | must be one of [0, 1, 2, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md index 99dcaa7a4ec367dc594847b76ef28f8e6e7c1a57..d92f3080973d3fcf922bc96dca6f5d2409e6364f 100644 --- a/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md +++ b/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | | defaults to 0, must be one of [0, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md index 4b8e39d9caddb9331d7399d8b089b9ace0a36f19..2fd432edc69d91a3840523a45e049e3aac0637ec 100644 --- a/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | | defaults to 0, must be one of [0, 1, 2, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md index e7fffa3be03a72d25d3f3e466d18603de9ba54f2..57cfa6d12ad15b3641419c9776ac6abe9c2c002d 100644 --- a/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md +++ b/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **shape_type** | **str** | | **triangle_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/List.md b/samples/openapi3/client/petstore/python/docs/List.md index 4b60956971aa8983cb144916960189b22430c4a0..13f2694de358defb8ca408c1a4dcbb1673f91e65 100644 --- a/samples/openapi3/client/petstore/python/docs/List.md +++ b/samples/openapi3/client/petstore/python/docs/List.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123_list** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/MapTest.md b/samples/openapi3/client/petstore/python/docs/MapTest.md index 15228ee1f282bc15b37f11748a3a07c394464ae7..e6584f3811e0587a24a17a59dbbb4411328108c2 100644 --- a/samples/openapi3/client/petstore/python/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python/docs/MapTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] **indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f489944a20afcb0a08aa61bdc5a2561c4bfa9dfe..f32c4e04134ba3605410a044ebe8020cb8c032f2 100644 --- a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] **map** | [**{str: (Animal,)}**](Animal.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Model200Response.md b/samples/openapi3/client/petstore/python/docs/Model200Response.md index c958bd4b33f846bbdc6742175b949b4b069012a3..f7ef7d79acf6341615b713a5bf67f966437556d2 100644 --- a/samples/openapi3/client/petstore/python/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python/docs/Model200Response.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **int** | | [optional] **_class** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ModelReturn.md b/samples/openapi3/client/petstore/python/docs/ModelReturn.md index 043e9d466fab1f75bed067fe12a48fcbcaa44376..75fb39a8869828c8bc4d30586b5f55cc6cdc92f5 100644 --- a/samples/openapi3/client/petstore/python/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python/docs/ModelReturn.md @@ -6,6 +6,7 @@ Model for testing reserved words Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_return** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Name.md b/samples/openapi3/client/petstore/python/docs/Name.md index 3be719cdbfbac0318f07e0363452e946bb86f2af..6e58fae6d0bb1aacb5ad9a5985c61522d0fa27aa 100644 --- a/samples/openapi3/client/petstore/python/docs/Name.md +++ b/samples/openapi3/client/petstore/python/docs/Name.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **snake_case** | **int** | | [optional] [readonly] **_property** | **str** | | [optional] **_123_number** | **int** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NullableClass.md b/samples/openapi3/client/petstore/python/docs/NullableClass.md index 863e93ddfbbca481b2854b8e162945db896d7b4b..48a27469f6c9ab61fd13346494b2d5cbb381e95b 100644 --- a/samples/openapi3/client/petstore/python/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python/docs/NullableClass.md @@ -13,10 +13,11 @@ Name | Type | Description | Notes **array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional] **array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional] **array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional] +**object_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] **object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional] **object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional] **object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional] -**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NumberOnly.md b/samples/openapi3/client/petstore/python/docs/NumberOnly.md index 37195c5d89943f572c28f8e2637650449b2c903e..172e86163a44b8f85b2870242f0cf68234249299 100644 --- a/samples/openapi3/client/petstore/python/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/NumberOnly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_number** | **float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md index 119e0f67823949d72a52065670f19ba70441f014..cc6f77c152c62255008d08c1a947112e8208a2c4 100644 --- a/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md +++ b/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **float** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md index a046561314c67695e435f7b607144aff39d57bec..60fe997afa052aab9eb1db0d0f44835f767fba30 100644 --- a/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md +++ b/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **my_readonly** | [**Readonly**](Readonly.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Order.md b/samples/openapi3/client/petstore/python/docs/Order.md index d29e1a381de899db143d90ef4d2f7802df76830b..0423082932d5de2a3dd2ce76ec7f38be44bdbc63 100644 --- a/samples/openapi3/client/petstore/python/docs/Order.md +++ b/samples/openapi3/client/petstore/python/docs/Order.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **ship_date** | **datetime** | | [optional] **status** | **str** | Order Status | [optional] **complete** | **bool** | | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Pet.md b/samples/openapi3/client/petstore/python/docs/Pet.md index ea4abdeb13d3734c2c9490b6364954d66d42391d..bb6e8d344e64071b4c8bb24184315c2bd4320266 100644 --- a/samples/openapi3/client/petstore/python/docs/Pet.md +++ b/samples/openapi3/client/petstore/python/docs/Pet.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **category** | [**Category**](Category.md) | | [optional] **tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md index 3b9c39d22306cc307f746f5e4025bccecbc08bb4..05573544bd797a472698ab4c854c2f9189e7ab76 100644 --- a/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md +++ b/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **quadrilateral_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md index 53b4c61d844572c4c42ddc6d0a8595a23547f29f..ba39ec3d04e488e5b3ad513e66f568dc068982ed 100644 --- a/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **str** | | [optional] [readonly] **baz** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Readonly.md b/samples/openapi3/client/petstore/python/docs/Readonly.md index 4f4ba8ede2516385a0820def3e92c3054575048e..e94598c9d38851977d376dbeae829c74017cfd4c 100644 --- a/samples/openapi3/client/petstore/python/docs/Readonly.md +++ b/samples/openapi3/client/petstore/python/docs/Readonly.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python/docs/ShapeInterface.md index 4d094158faba6b0ca5f9752db5d845b40b7ed2ee..012d4a0cdd867a85eeedd160eb8125a330233d2b 100644 --- a/samples/openapi3/client/petstore/python/docs/ShapeInterface.md +++ b/samples/openapi3/client/petstore/python/docs/ShapeInterface.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **shape_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md b/samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md index ee0aeb17ce1a6175fff7e3fad1f2f0637ae0f5cf..6704f480eb3b34adff2c67b2cc70eaca97ecf61a 100644 --- a/samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md +++ b/samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_self** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python/docs/SpecialModelName.md index 268e1134192d09305eab3e5fc28ba257c15341c2..4a1c86ff4de0b2afbd3e14cfcdf876d60713e7f8 100644 --- a/samples/openapi3/client/petstore/python/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python/docs/SpecialModelName.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **special_property_name** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/StringEnum.md b/samples/openapi3/client/petstore/python/docs/StringEnum.md index b03f3b1e6c6434f19feae7b13e02c2f1eb2f0f89..29e160a9b07e0181705e63abd963c8bcdf27189a 100644 --- a/samples/openapi3/client/petstore/python/docs/StringEnum.md +++ b/samples/openapi3/client/petstore/python/docs/StringEnum.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **value** | **str** | | must be one of ["placed", "approved", "delivered", "single quoted", '''multiple lines''', '''double quote with newline''', ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md index 7799b93d822337da78e0fcc29121d2a86e238eba..700a2caf3b840639e83c4852271fe7995bdc8816 100644 --- a/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | | defaults to "placed", must be one of ["placed", "approved", "delivered", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Tag.md b/samples/openapi3/client/petstore/python/docs/Tag.md index 4ccac4949afcb420d6a31b2bfdcf835f058ecdd3..8a95090c036d022b9099be75ccaddfa3582e0d79 100644 --- a/samples/openapi3/client/petstore/python/docs/Tag.md +++ b/samples/openapi3/client/petstore/python/docs/Tag.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] **name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python/docs/TriangleInterface.md index 494c224cd313993ec9b0f0ae4d73282deb09fe2c..9f8411eabdf298f347cf9b714ef91a6bab421905 100644 --- a/samples/openapi3/client/petstore/python/docs/TriangleInterface.md +++ b/samples/openapi3/client/petstore/python/docs/TriangleInterface.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **triangle_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/User.md b/samples/openapi3/client/petstore/python/docs/User.md index a4cb117e63a9db34b71f5915df54e09c0ec0bd6f..4d2da357adb16f93100bc02c41a12607f2719fe7 100644 --- a/samples/openapi3/client/petstore/python/docs/User.md +++ b/samples/openapi3/client/petstore/python/docs/User.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **object_with_no_declared_props_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] **any_type_prop** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] **any_type_prop_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Whale.md b/samples/openapi3/client/petstore/python/docs/Whale.md index ea48bff6bc396e5a087a1a3c154b075903edcf5c..500786012ead9e823a1f6707b8d8c01e649d180a 100644 --- a/samples/openapi3/client/petstore/python/docs/Whale.md +++ b/samples/openapi3/client/petstore/python/docs/Whale.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **class_name** | **str** | | **has_baleen** | **bool** | | [optional] **has_teeth** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py index 3b526cd54e36808fa702014a7e627881dc100b27..82aca2a9ca8d3cccd6b4b69bfae2add6758ed2e1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py @@ -57,7 +57,13 @@ class AdditionalPropertiesClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -78,7 +84,7 @@ class AdditionalPropertiesClass(ModelNormal): 'map_with_undeclared_properties_anytype_1': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 'map_with_undeclared_properties_anytype_2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 'map_with_undeclared_properties_anytype_3': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'empty_map': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 + 'empty_map': (dict,), # noqa: E501 'map_with_undeclared_properties_string': ({str: (str,)},), # noqa: E501 } @@ -150,7 +156,7 @@ class AdditionalPropertiesClass(ModelNormal): map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - empty_map (bool, date, datetime, dict, float, int, list, str): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 + empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py index a3d48b6ea97538be659a8e85c4af51af9f6cca07..c53b1e1ad289b72ac12668779a1aa493f78b57b5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py @@ -63,7 +63,14 @@ class Animal(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py index 838b18a1297081865e6fb98fed3495154603f168..fb58224ebd4c33587e278fb69c816cc972fc1196 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py @@ -57,7 +57,14 @@ class AnimalFarm(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py index 01e2175b8004e1e12e26f4e37b0ed08a44384675..53adb5aba12fa832cafb47a2e2a18819cb572737 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py @@ -57,7 +57,13 @@ class ApiResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py index 29d34a1efe8b477471325b9f7927187d19cb7acf..4068d2488e570b955f63bbdc3ffc744bc7dae93b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py @@ -68,7 +68,13 @@ class Apple(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = True @@ -109,9 +115,12 @@ class Apple(ModelNormal): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, cultivar, *args, **kwargs): # noqa: E501 """Apple - a model defined in OpenAPI + Args: + cultivar (str): + Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -143,7 +152,6 @@ class Apple(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - cultivar (str): [optional] # noqa: E501 origin (str): [optional] # noqa: E501 """ @@ -170,6 +178,7 @@ class Apple(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.cultivar = cultivar for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py index 008b74dd42a3dba68a613c14fc18796163305889..8b6a2c42d0ede2e9425e94fb39492444bb29e6c0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py @@ -57,7 +57,13 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py index a3dc283969aeaad34a2dcb99bde88a231d27ef6e..8d9962152edf95eb86f453acf7dc93f3be8fa32c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py @@ -57,7 +57,14 @@ class ArrayOfEnums(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py index f2e080bc258ecef70e7f4f4345c1691107b752a1..7b754dc283e6ffd250119826a0ad4b6c6ffe862b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py @@ -57,7 +57,13 @@ class ArrayOfNumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py index ac42b07b93c9a525df0b5fc14ba55c32aebc324f..9691a1e603740fbc6615a1472f5140f2bdfcb793 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py @@ -61,7 +61,14 @@ class ArrayTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py index 513bd6bf06b189d0398493b06cab4b8b3d40a9f5..24ad257e6d213cfdbd5180e27991353a64f60135 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py @@ -57,7 +57,13 @@ class Banana(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,9 +102,12 @@ class Banana(ModelNormal): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, length_cm, *args, **kwargs): # noqa: E501 """Banana - a model defined in OpenAPI + Args: + length_cm (float): + Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -130,7 +139,6 @@ class Banana(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - length_cm (float): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -156,6 +164,7 @@ class Banana(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.length_cm = length_cm for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py index 603f7761867cc1edc05ee2d6a6123ffe1f78df5d..25b336460bc4d84517faaa4290cbf2a937d2fd65 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py @@ -57,7 +57,13 @@ class BasquePig(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py index 710c17e51a56e9c0e2eef5475cadca09d434a62a..6d939535ceefb58b016dc16bd628d95813d37c55 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py @@ -57,7 +57,13 @@ class Capitalization(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py index 1d62177c6c2edfd6fede41f32e49505b09f002b1..eeea79359fc9846f59bf06a90f73da7d6a0e7073 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py @@ -27,10 +27,8 @@ from petstore_api.model_utils import ( # noqa: F401 ) def lazy_import(): - from petstore_api.model.address import Address from petstore_api.model.animal import Animal from petstore_api.model.cat_all_of import CatAllOf - globals()['Address'] = Address globals()['Animal'] = Animal globals()['CatAllOf'] = CatAllOf @@ -120,13 +118,11 @@ class Cat(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Cat - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -191,26 +187,18 @@ class Cat(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) @@ -229,7 +217,6 @@ class Cat(ModelComposed): 'anyOf': [ ], 'allOf': [ - Address, Animal, CatAllOf, ], diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py index 50b046510dfaa37582c93936ac3c573e9ea69bf0..7efba680b4d89f15b223a9935016c19ed18ceef3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py @@ -57,7 +57,13 @@ class CatAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/category.py b/samples/openapi3/client/petstore/python/petstore_api/model/category.py index ed167471d35664c90ae5f591c851aa2a6c24bc85..4936b4f0e44353585296685e31a7aeb9398a47c0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/category.py @@ -57,7 +57,13 @@ class Category(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py index e1869c917cd8033ec519bd37b4cceb460244c0b3..d054cb7a97a012c4f583a8b0afc0723fa5180e36 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py @@ -116,13 +116,11 @@ class ChildCat(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ChildCat - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -186,26 +184,18 @@ class ChildCat(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py index f0f1a1ae6bd46c871864ab289ab349193c76b621..3d732d085fba8bd36b58b5eb76c0ab527e951f30 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py @@ -57,7 +57,13 @@ class ChildCatAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py index 18c16f89f908c05047e2b217643a690890df041c..9e65a93736504ee985041a57bd3fd1cf335e92dd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py @@ -57,7 +57,13 @@ class ClassModel(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/client.py b/samples/openapi3/client/petstore/python/petstore_api/model/client.py index da615c54773113cf651c11f07635e2edb4b0c5d7..6218de1e19e481d92bb228fd4c6015376d1ead74 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/client.py @@ -57,7 +57,13 @@ class Client(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py index 56853f5f34f19fc647634fbb5837c118b5c3505f..e461673adbd429a3b88bd6384ad23f397b3468cd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py @@ -113,14 +113,12 @@ class ComplexQuadrilateral(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ComplexQuadrilateral - a model defined in OpenAPI - Args: + Keyword Args: shape_type (str): quadrilateral_type (str): - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -183,27 +181,18 @@ class ComplexQuadrilateral(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - 'quadrilateral_type': quadrilateral_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py index 4a1129432f547f0030c5ef80aabd87c86aff60d3..299c866cf8f3263dc35330f4c46b3c1ee23ac5d1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py @@ -181,25 +181,18 @@ class ComposedOneOfNumberWithValidations(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py new file mode 100644 index 0000000000000000000000000000000000000000..518f4774b5557632f703a836f7948c3c87eee999 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py @@ -0,0 +1,212 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from petstore_api.model.tag import Tag + globals()['Tag'] = Tag + + +class ComposedSchemaWithPropsAndNoAddProps(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'color': (str,), # noqa: E501 + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'color': 'color', # noqa: E501 + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ComposedSchemaWithPropsAndNoAddProps - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] # noqa: E501 + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Tag, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py index 5a6e424a4ec9ee518c11128011c9d5aae2854318..82215915e84c63bcff5ac69ffa8df215b96dd37f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py @@ -57,7 +57,13 @@ class DanishPig(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py index 8bf6d8fd3ade2511f22026801079d06806e4e32f..3452f0d040a070a80b3cd6b42e160fa32be049e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py @@ -118,13 +118,11 @@ class Dog(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Dog - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -189,26 +187,18 @@ class Dog(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py index b7b2e7db66d9a119ab7ce5523d7ea99f8a10cf2a..962903d3a381919ae8733a12ac8993c85e52cabb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py @@ -57,7 +57,13 @@ class DogAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py index 43ebac57de38367e7566dd830b193ed380c26b47..db56838d7e495fcffa800060fad9e1a72b20e052 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py @@ -65,7 +65,13 @@ class EnumArrays(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py index 14188ca31d2839d23e1eafae39a0a900da72ffb9..63be703c38e9f732b635e400ac797d134fd4f6d7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py @@ -58,7 +58,13 @@ class EnumClass(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py index c0284b371a93c56c3bc2018661042ca4ce8d2317..23ddbcf9a2ca0e61ffd81a5ea7d187ae09dae783 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py @@ -89,7 +89,14 @@ class EnumTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py index a536701d701ed5a1adf6c14158a701d4b9657e3b..e5e4104bd024c29e03ef8efed64c5348e4111ecf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py @@ -113,14 +113,12 @@ class EquilateralTriangle(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """EquilateralTriangle - a model defined in OpenAPI - Args: + Keyword Args: shape_type (str): triangle_type (str): - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -183,27 +181,18 @@ class EquilateralTriangle(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - 'triangle_type': triangle_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fake_get_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python/petstore_api/model/fake_get_inline_additional_properties_payload_array_data.py index bbbc449b4298990868653f44751f8ee0103d5f96..833bbdd8261c9fa39f89652762d5949b31d3d509 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fake_get_inline_additional_properties_payload_array_data.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fake_get_inline_additional_properties_payload_array_data.py @@ -57,7 +57,13 @@ class FakeGetInlineAdditionalPropertiesPayloadArrayData(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file.py b/samples/openapi3/client/petstore/python/petstore_api/model/file.py index a38cccacc6abba832392b9c245077173f9878f9b..137d002632429d57c3ae77539d600b589725fcb5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file.py @@ -57,7 +57,13 @@ class File(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py index b8c519ed9c7c1f9347c45de3e0f48eaff3cb25e4..3722125ae4859a5862bcf256c50f5526caa59d33 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py @@ -61,7 +61,14 @@ class FileSchemaTestClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py index ebbb09adf91e198f5e6375d214deb25cad25593e..7c319dc9995d14f22faea4d96fcf08c42ee34d60 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py @@ -57,7 +57,13 @@ class Foo(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py index b232da04b45ed1732b7b87d1a3c39bb6c485ffb0..cce7f7f09819d21dd8aad5b2334b4dba100ce723 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py @@ -100,7 +100,13 @@ class FormatTest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py index 15ea987edf5d229b8e0d578d470d3556d0d6ae0b..c7283f99d0c7fe4972ad08796baf069bd05f2586 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py @@ -74,7 +74,14 @@ class Fruit(ModelComposed): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,10 +97,10 @@ class Fruit(ModelComposed): """ lazy_import() return { - 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 'length_cm': (float,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'origin': (str,), # noqa: E501 } @cached_property @@ -102,10 +109,10 @@ class Fruit(ModelComposed): attribute_map = { - 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 - 'origin': 'origin', # noqa: E501 'length_cm': 'lengthCm', # noqa: E501 + 'color': 'color', # noqa: E501 + 'origin': 'origin', # noqa: E501 } required_properties = set([ @@ -125,6 +132,8 @@ class Fruit(ModelComposed): """Fruit - a model defined in OpenAPI Keyword Args: + cultivar (str): + length_cm (float): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -156,9 +165,7 @@ class Fruit(ModelComposed): through its discriminator because we passed in _visited_composed_classes = (Animal,) color (str): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 origin (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -191,25 +198,18 @@ class Fruit(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py index 13c4d6424a58f727c6a66b6ba1652a525edea784..519aa6d20eb5662d6a34d7d432b8079454350166 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py @@ -63,7 +63,14 @@ class FruitReq(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -180,25 +187,18 @@ class FruitReq(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py index f3ad29beb4c4b8b22504af63e77989531439bccf..dc9299c2a1b60a299d7fb52385d7068932b8f350 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py @@ -74,7 +74,14 @@ class GmFruit(ModelComposed): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,10 +97,10 @@ class GmFruit(ModelComposed): """ lazy_import() return { - 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 'length_cm': (float,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'origin': (str,), # noqa: E501 } @cached_property @@ -102,10 +109,10 @@ class GmFruit(ModelComposed): attribute_map = { - 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 - 'origin': 'origin', # noqa: E501 'length_cm': 'lengthCm', # noqa: E501 + 'color': 'color', # noqa: E501 + 'origin': 'origin', # noqa: E501 } required_properties = set([ @@ -125,6 +132,8 @@ class GmFruit(ModelComposed): """GmFruit - a model defined in OpenAPI Keyword Args: + cultivar (str): + length_cm (float): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -156,9 +165,7 @@ class GmFruit(ModelComposed): through its discriminator because we passed in _visited_composed_classes = (Animal,) color (str): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 origin (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -191,25 +198,18 @@ class GmFruit(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py index f7c417562ece8fd6374f4d283c3bbd49900c9fee..70523affd89043e42b9661d3ec0f663b87405c8a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py @@ -63,7 +63,14 @@ class GrandparentAnimal(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py index c94781ae2c462240fc093c18cadef278a4ee857b..4ea0bb08721789f91c4986f20d8931d6068e5d91 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py @@ -57,7 +57,13 @@ class HasOnlyReadOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py index 3c0cd37dfad9bec80e7bb18296faebccca172213..356ddea3cb146584b1a5882565e4865d45cd9595 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py @@ -57,7 +57,13 @@ class HealthCheckResult(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py index 4d8e8aecff39a2b122c6cc95d7dada681df54ca2..9c78998902a2e2943605d92e78f90e6de6b2b3ab 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py @@ -61,7 +61,14 @@ class InlineAdditionalPropertiesRefPayload(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py index d60fec5fa687dd0b02e586596429b70cd87922d2..ee93b74eac981e88aa93ed36d6d049d95d1fce72 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py @@ -61,7 +61,14 @@ class InlineObject6(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py index 8e814cf4383828bd6c122ea4ee142cb77b4fc589..cb7b9985ea8587abc18877a86fb8ca1fb791cff4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py @@ -61,7 +61,14 @@ class InlineResponseDefault(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py index a01fc6149225f504f5fd3f244054b234594d298d..a31cd7c56958a55d6aa872c415c60b332119cc97 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py @@ -58,7 +58,13 @@ class IntegerEnum(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py index 0d69cd535b3188b0aa34ecffb8b6e47c2c717895..f8fc86bfba7fb30a2bacb5a61cd7112194ecca4d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py @@ -56,7 +56,13 @@ class IntegerEnumOneValue(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py index 958b2ad2e39a4687922bc9772644372f18bc2ceb..3c56da865f6c77927b2b380fb271a5a2c01c9267 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py @@ -58,7 +58,13 @@ class IntegerEnumWithDefaultValue(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py index 27197f5a235ba1e0b07f1b4dde2616534611b93c..b1f64bcb0db9daa7e4733e3570e29271a0d3b1f3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py @@ -63,7 +63,14 @@ class IsoscelesTriangle(ModelComposed): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -106,14 +113,12 @@ class IsoscelesTriangle(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """IsoscelesTriangle - a model defined in OpenAPI - Args: + Keyword Args: shape_type (str): triangle_type (str): - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -176,27 +181,18 @@ class IsoscelesTriangle(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - 'triangle_type': triangle_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/list.py b/samples/openapi3/client/petstore/python/petstore_api/model/list.py index 09c762d6a79421da4b99e9981e7614b0746c65ec..11b46f10b565fffacb8d3a5626aae8a7430e0b7f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/list.py @@ -57,7 +57,13 @@ class List(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py index 067adf793505f4a67b0e1d052d30a0612e02d3d6..234933fe1a8e7213476bfc588033dd7dcb4c4614 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py @@ -131,13 +131,11 @@ class Mammal(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Mammal - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -203,26 +201,18 @@ class Mammal(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py index 169fb9d88ee0d30261cee78c2747dc4679adb648..a5418b39e734fa3c4c318a4b955a4f4a0c81d68c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py @@ -65,7 +65,14 @@ class MapTest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py index 01df80d9d62b3a734d65f1412df9c810e497cb22..67b3f79d9e5f36b1efa817fbf76c6aa4bf99949c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -61,7 +61,14 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py index 46b155b65239225575decfb2ba17d2b9ae43b68c..056f4c56ad35d1889d4f506158624f8d152f300c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py @@ -57,7 +57,13 @@ class Model200Response(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py index 377b3507a8b3e3ecbf6c3a784d86b4f925c5a7e9..5f34582cdb4a779c12defa27672022d7194e65e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py @@ -57,7 +57,13 @@ class ModelReturn(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/name.py b/samples/openapi3/client/petstore/python/petstore_api/model/name.py index 1432e185ad6b33a2ec2707e74423f168b3ec8f10..06b387ce9bfe6839d952e5c48bfdc1c8d719d5ec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/name.py @@ -57,7 +57,13 @@ class Name(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py index a117dfa691606383d44abc49878e3b1d1b6df044..f2c2cb7642e63f9c391767d2dc71fcc52556f506 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py @@ -63,7 +63,7 @@ class NullableClass(ModelNormal): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,) # noqa: E501 + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -87,6 +87,7 @@ class NullableClass(ModelNormal): 'array_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type,), # noqa: E501 'array_and_items_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type,), # noqa: E501 'array_items_nullable': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type],), # noqa: E501 + 'object_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 'object_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type,), # noqa: E501 'object_and_items_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type,), # noqa: E501 'object_items_nullable': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)},), # noqa: E501 @@ -107,6 +108,7 @@ class NullableClass(ModelNormal): 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable': 'object_nullable', # noqa: E501 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 'object_items_nullable': 'object_items_nullable', # noqa: E501 @@ -167,6 +169,7 @@ class NullableClass(ModelNormal): array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 + object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py index fcd20ddfbc19fe6bb8d37331981c5f5d5acc2766..a2cf17e3e7b969a4fb74a2fb9e2980f7050d27fe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py @@ -121,13 +121,11 @@ class NullableShape(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """NullableShape - a model defined in OpenAPI - Args: - shape_type (str): - Keyword Args: + shape_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -192,26 +190,18 @@ class NullableShape(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py index d4892dbede5b53f15e2a614ace9ebf3155cb1355..cb2c9e2ad52685625196092f264176155ced73ee 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py @@ -57,7 +57,13 @@ class NumberOnly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py index ffa5e9cf4621cd27b19a4ed5c3e91cb895c3e2a3..a3b2746c22b5daeec9114aae06d544722011b844 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py @@ -57,7 +57,13 @@ class NumberWithValidations(ModelSimple): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py index ee3613c444419e905eaf02daf44fd9fceb74e1c7..11db10a6128c2645d4962f863f3aa0e63cadcce6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py @@ -63,7 +63,14 @@ class ObjectModelWithRefProps(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/order.py b/samples/openapi3/client/petstore/python/petstore_api/model/order.py index b42f066848abdeac9684274b463a6aab5d703dda..48207e4560eb990001d1daa2348e6c0b9ced72da 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/order.py @@ -62,7 +62,13 @@ class Order(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py index 16099236da34398fb5cdfc76774b5f64f7047c23..bda9c2779965d35a4f3dbef8cf9bcc66dd2e3f2f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py @@ -116,13 +116,11 @@ class ParentPet(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ParentPet - a model defined in OpenAPI - Args: - pet_type (str): - Keyword Args: + pet_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -185,26 +183,18 @@ class ParentPet(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'pet_type': pet_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py index e9f1e30a3196009737f3fcd5d85018ea1c755673..b0c8b08607d107e62412cc5cff6e4fed943c4b33 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py @@ -68,7 +68,14 @@ class Pet(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py index 4a6f200f6ffcd31399d9aa81f41b1f500ec7e445..21f61c65de089dd091e71427389b4343eabf2353 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py @@ -117,13 +117,11 @@ class Pig(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Pig - a model defined in OpenAPI - Args: - class_name (str): - Keyword Args: + class_name (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -186,26 +184,18 @@ class Pig(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'class_name': class_name, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py index 4e28ac0d2389201cf12f8a2ce104ff5050594562..d15d37cdbca983d4befb58fab7ee8cea56a68b3d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py @@ -119,13 +119,11 @@ class Quadrilateral(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Quadrilateral - a model defined in OpenAPI - Args: - quadrilateral_type (str): - Keyword Args: + quadrilateral_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -189,26 +187,18 @@ class Quadrilateral(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'quadrilateral_type': quadrilateral_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py index 124d9128bc53133f53e7079ac187b3abd8a462fa..872608885aca74f355e9d66ed8cd44fc811cf94d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py @@ -57,7 +57,13 @@ class QuadrilateralInterface(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py index 5c68eab91ea391b3496a9a69b5db0800bbdaeff1..0302bf96a7e56c6cde4db736436ad1d349a554b8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py @@ -57,7 +57,13 @@ class ReadOnlyFirst(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py b/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py index b5d137b467d3c91e633b1579236a78b40997110b..7d038917bb433689b386e29c0ad951c7d324e54a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py @@ -57,7 +57,13 @@ class Readonly(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py index 1e3893627dadb9057f1b0802bb700f0e09f6d813..86fc0a4f4959ba5c845322bf31d1fcfe47995827 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py @@ -113,14 +113,12 @@ class ScaleneTriangle(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ScaleneTriangle - a model defined in OpenAPI - Args: + Keyword Args: shape_type (str): triangle_type (str): - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -183,27 +181,18 @@ class ScaleneTriangle(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - 'triangle_type': triangle_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py index f5e3c142b914837f49f80d5321fd2f76edce46d9..763a7aa362b0684607dc9982219af4569a7d49c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py @@ -121,13 +121,11 @@ class Shape(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Shape - a model defined in OpenAPI - Args: - shape_type (str): - Keyword Args: + shape_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -192,26 +190,18 @@ class Shape(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py index 8a3c52088be3c48f254b3be71526012ffbea99b3..b8ab31fc31c60459d113c041cfd666a188b7a31f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py @@ -57,7 +57,13 @@ class ShapeInterface(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py index 480fa5bd5d657fad743bf8837c7bbc80691fac5a..403449e0c9c24c494426b56635cfaab319a7e82c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py @@ -121,13 +121,11 @@ class ShapeOrNull(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """ShapeOrNull - a model defined in OpenAPI - Args: - shape_type (str): - Keyword Args: + shape_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -192,26 +190,18 @@ class ShapeOrNull(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py index f2f0a61acbd2c65fda01fb86a5f48822a71ddbb8..d68f1d3b5cb307b29126da64e8b6bf9a276d4da8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py @@ -113,14 +113,12 @@ class SimpleQuadrilateral(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """SimpleQuadrilateral - a model defined in OpenAPI - Args: + Keyword Args: shape_type (str): quadrilateral_type (str): - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -183,27 +181,18 @@ class SimpleQuadrilateral(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'shape_type': shape_type, - 'quadrilateral_type': quadrilateral_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py index 683d1794293cafe47bcce7a1a7e54dad1dc41f7a..72687c02ab6913182bd416bee1470dde955b6ff1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py @@ -173,25 +173,18 @@ class SomeObject(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py index 343122b65f3b3a1d479006890b5fa194c6bd0571..3fba94014b5c1e4de37c9dd85aa5b3ab9d497b19 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py @@ -57,7 +57,13 @@ class SomeObjectWithSelfAttr(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py index 823e77596636c81d969e568a0b36e6e56ddb56ba..cfaedbc7881506d18a5b616abc4992289f845237 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py @@ -57,7 +57,13 @@ class SpecialModelName(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py index a6d2fbee08f256b1b8140960d74a24f13de19924..1e48fdecbf497ce8458b7c91b122153ca705294e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py @@ -64,7 +64,13 @@ lines''', validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py index 4dfc426446ca965f9616f2a344f7940541508bec..1417d0ff0fc101e49dc90c13f82816ef4c891222 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py @@ -58,7 +58,13 @@ class StringEnumWithDefaultValue(ModelSimple): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py index e5fc749d5149e34bbea9aa8608a2e65f2c027eb1..0e7427effa67f87e8ea0ddcd7adffc6535deee3c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py @@ -57,7 +57,13 @@ class Tag(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py index 83d6e52e886735d7eaf63c4c1f15d75631270095..b1112e24892d3216799a8694ccffeda33c153904 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py @@ -122,13 +122,11 @@ class Triangle(ModelComposed): ]) @convert_js_args_to_python_args - def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Triangle - a model defined in OpenAPI - Args: - triangle_type (str): - Keyword Args: + triangle_type (str): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -192,26 +190,18 @@ class Triangle(ModelComposed): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'triangle_type': triangle_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py index c54bd081172016b74a46fbd5b3e9e517d4ec64c1..f31e3dba135815092fc7c68e38b9d7d021311d59 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py @@ -57,7 +57,13 @@ class TriangleInterface(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/user.py b/samples/openapi3/client/petstore/python/petstore_api/model/user.py index 7613ac7dc26361496f9e75c118512237378c5540..2271e3e37e518234bd52a68cf900dfd9d4b02efb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/user.py @@ -57,7 +57,13 @@ class User(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py index e6400ea34fc754ae0cf70114df75a5ce588a3596..c3e1c40b4e514f4459d7aa72c294db2a816d2fc0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py @@ -57,7 +57,13 @@ class Whale(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False diff --git a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py index f73278f35cc7eb414b5cff724f44716c77daceda..3a555f0a88c43615eb88534c30370f73d7f4489c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py @@ -434,27 +434,43 @@ class ModelComposed(OpenApiModel): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -464,13 +480,12 @@ class ModelComposed(OpenApiModel): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1584,8 +1599,13 @@ def get_allof_instances(self, model_args, constant_args): self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1593,20 +1613,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1666,31 +1674,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1747,24 +1733,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1777,47 +1747,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1861,36 +1818,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index 12f8d86da03dba4ec88ad47d586ee5d19b66ee68..ef47f62075b44ecec0489b0ac42a839f06902c14 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -34,6 +34,7 @@ from petstore_api.model.class_model import ClassModel from petstore_api.model.client import Client from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations +from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps from petstore_api.model.danish_pig import DanishPig from petstore_api.model.dog import Dog from petstore_api.model.dog_all_of import DogAllOf diff --git a/samples/openapi3/client/petstore/python/pom.xml b/samples/openapi3/client/petstore/python/pom.xml index c2364c74482870eb2dd23f6d9c3c85423d7acbc5..e7d7d9caf133400b6bc5e427655829c2f70d0e83 100644 --- a/samples/openapi3/client/petstore/python/pom.xml +++ b/samples/openapi3/client/petstore/python/pom.xml @@ -1,10 +1,10 @@ <project> <modelVersion>4.0.0</modelVersion> <groupId>org.openapitools</groupId> - <artifactId>PythonExperimentalOAS3PetstoreTests</artifactId> + <artifactId>PythonOAS3PetstoreTests</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> - <name>Python-Experimental OpenAPI3 Petstore Client</name> + <name>Python OpenAPI3 Petstore Client</name> <build> <plugins> <plugin> diff --git a/samples/openapi3/client/petstore/python/test/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python/test/test_composed_schema_with_props_and_no_add_props.py new file mode 100644 index 0000000000000000000000000000000000000000..7e7ac901ca6dd5a2503182dcfc82870e3e5fc710 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_composed_schema_with_props_and_no_add_props.py @@ -0,0 +1,37 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.tag import Tag +globals()['Tag'] = Tag +from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps + + +class TestComposedSchemaWithPropsAndNoAddProps(unittest.TestCase): + """ComposedSchemaWithPropsAndNoAddProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testComposedSchemaWithPropsAndNoAddProps(self): + """Test ComposedSchemaWithPropsAndNoAddProps""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedSchemaWithPropsAndNoAddProps() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_schema_with_props_and_no_add_props.py new file mode 100644 index 0000000000000000000000000000000000000000..d219a4e4b8aa0d9ea29bcbf5451f0ff2c83e65ee --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_schema_with_props_and_no_add_props.py @@ -0,0 +1,45 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.tag import Tag +globals()['Tag'] = Tag +from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps + + +class TestComposedSchemaWithPropsAndNoAddProps(unittest.TestCase): + """ComposedSchemaWithPropsAndNoAddProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testComposedSchemaWithPropsAndNoAddProps(self): + """Test ComposedSchemaWithPropsAndNoAddProps""" + + inst = ComposedSchemaWithPropsAndNoAddProps(color='red') + + # ComposedSchemaWithPropsAndNoAddProps should only allow in the color property + # once https://github.com/OpenAPITools/openapi-generator/pull/8816 lands + # this will no longer work + # TODO update the test then + inst = ComposedSchemaWithPropsAndNoAddProps(color='red', id=1, name='foo') + + with self.assertRaises(petstore_api.ApiAttributeError): + inst = ComposedSchemaWithPropsAndNoAddProps(color='red', id=1, name='foo', additional=5) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index 37e0943273add0b9cb6ccb43c71475345ac45a6c..93538160f9a8c2d3257c3acc5b4676f05c0e560e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -118,12 +118,7 @@ class DeserializationTests(unittest.TestCase): ) assert isinstance(inst, apple.Apple) - inst = apple.Apple( - origin="cHiLe" - ) - assert isinstance(inst, apple.Apple) - - # Test with invalid regex pattern. + # Test with invalid regex pattern in cultivar err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") with self.assertRaisesRegex( petstore_api.ApiValueError, @@ -133,12 +128,14 @@ class DeserializationTests(unittest.TestCase): cultivar="!@#%@$#Akane" ) + # Test with invalid regex pattern in origin err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("origin", "[^`]*") ): inst = apple.Apple( + cultivar="Akane", origin="!@#%@$#Chile" ) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py index d8b71e44353e65026901b3c6f649d0418cef0582..ed1ca736d4ba7434e4c12cb84839ff96487d0f49 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py @@ -16,7 +16,7 @@ import re import unittest import petstore_api -from petstore_api.model import cat, dog, isosceles_triangle, banana_req +from petstore_api.model import cat, dog, isosceles_triangle, banana_req, fruit_req from petstore_api import Configuration, signing from petstore_api.model_utils import ( @@ -54,17 +54,17 @@ class DiscardUnknownPropertiesTests(unittest.TestCase): 'Exception message: {0}'.format(str(cm.exception))) - def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): + def test_deserialize_fruit_req_do_not_discard_unknown_properties(self): """ - deserialize IsoscelesTriangle with unknown properties. + deserialize FruitReq with unknown properties. Strict validation is enabled. Composed schema scenario. """ config = Configuration(discard_unknown_keys=False) api_client = petstore_api.ApiClient(config) data = { - 'shape_type': 'Triangle', - 'triangle_type': 'EquilateralTriangle', + 'lengthCm': 21.3, + 'sweet': False, # Below is an unknown property not explicitly declared in the OpenAPI document. # It should not be in the payload because additional properties (undeclared) are # not allowed in the schema (additionalProperties: false). @@ -74,10 +74,29 @@ class DiscardUnknownPropertiesTests(unittest.TestCase): # Deserializing with strict validation raises an exception because the 'unknown_property' # is undeclared. - with self.assertRaises(petstore_api.ApiValueError) as cm: - deserialized = api_client.deserialize(response, ((isosceles_triangle.IsoscelesTriangle),), True) - self.assertTrue(re.match('.*Not all inputs were used.*unknown_property.*', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) + with self.assertRaisesRegex(petstore_api.ApiValueError, "Invalid inputs given to generate an instance of FruitReq. None of the oneOf schemas matched the input data."): + deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) + + + def test_deserialize_fruit_req_discard_unknown_properties(self): + """ + deserialize FruitReq with unknown properties. + Strict validation is enabled. + Composed schema scenario. + """ + config = Configuration(discard_unknown_keys=True) + api_client = petstore_api.ApiClient(config) + data = { + 'lengthCm': 21.3, + 'sweet': False, + # Below is an unknown property not explicitly declared in the OpenAPI document. + # It should not be in the payload because additional properties (undeclared) are + # not allowed in BananaReq + 'unknown_property': 'a-value' + } + response = MockResponse(data=json.dumps(data)) + deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) + self.assertNotIn("unknown_property", deserialized.to_dict().keys()) def test_deserialize_banana_req_discard_unknown_properties(self): @@ -145,13 +164,10 @@ class DiscardUnknownPropertiesTests(unittest.TestCase): # Below are additional (undeclared) properties. "my_additional_property": 123, } - # The 'my_additional_property' is undeclared, but 'Cat' has a 'Address' type through - # the allOf: [ $ref: '#/components/schemas/Address' ]. + # The 'my_additional_property' is undeclared response = MockResponse(data=json.dumps(data)) deserialized = api_client.deserialize(response, ((cat.Cat),), True) self.assertTrue(isinstance(deserialized, cat.Cat)) - # Check the 'unknown_property' and 'more-unknown' properties are not present in the - # output. - self.assertIn("declawed", deserialized.to_dict().keys()) + # Check the 'my_additional_property' is present self.assertIn("my_additional_property", deserialized.to_dict().keys()) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py index a60fdb9f6be3e2b83c57f250aaf2e7c711270915..f95c07755f854941bdb24839d11285577a0cca92 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py @@ -14,56 +14,70 @@ import sys import unittest import petstore_api -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] +from petstore_api.model import apple +from petstore_api.model import banana from petstore_api.model.fruit import Fruit class TestFruit(unittest.TestCase): """Fruit unit test stubs""" + length_cm = 20.3 + color = 'yellow' + + def setUp(self): pass def tearDown(self): pass - def testFruit(self): - """Test Fruit""" + def test_fruit_with_additional_props(self): + # including extra parameters works because the oneOf models include additionalProperties + some_value = 'some_value' + some_fruit = Fruit( + color=self.color, + length_cm=self.length_cm, + unknown_property=some_value + ) + assert some_fruit['unknown_property'] == some_value + + def test_fruit_assigning_additional_props_in_client(self): + # setting a value that doesn't exist works because additional_properties_type allows any type + other_fruit = Fruit(length_cm=self.length_cm, color=self.color) + blah = 'blah' + other_fruit['a'] = blah + assert other_fruit.a == blah + + # with setattr + setattr(other_fruit, 'b', blah) + assert other_fruit.b == blah - # make an instance of Fruit, a composed schema oneOf model - # banana test - length_cm = 20.3 - color = 'yellow' - fruit = Fruit(length_cm=length_cm, color=color) - # check its properties - self.assertEqual(fruit.length_cm, length_cm) - self.assertEqual(fruit['length_cm'], length_cm) - self.assertEqual(fruit.get('length_cm'), length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), length_cm) - self.assertEqual(fruit.color, color) - self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - # check the dict representation self.assertEqual( - fruit.to_dict(), + other_fruit.to_dict(), { - 'length_cm': length_cm, - 'color': color + 'a': 'blah', + 'b': 'blah', + 'length_cm': self.length_cm, + 'color': self.color } ) - # setting a value that doesn't exist raises an exception + + def test_fruit_access_errors(self): + fruit = Fruit(length_cm=self.length_cm, color=self.color) + + # getting a value that doesn't exist raises an exception # with a key with self.assertRaises(AttributeError): - fruit['invalid_variable'] = 'some value' + invalid_variable = fruit['cultivar'] + + # Per Python doc, if the named attribute does not exist, + # default is returned if provided, otherwise AttributeError is raised. + with self.assertRaises(AttributeError): + getattr(fruit, 'cultivar') + + def test_fruit_attribute_access(self): + fruit = Fruit(length_cm=self.length_cm, color=self.color) # Assert that we can call the builtin hasattr() function. # hasattr should return False for non-existent attribute. @@ -74,14 +88,6 @@ class TestFruit(unittest.TestCase): # hasattr should return True for existent attribute. self.assertTrue(hasattr(fruit, 'color')) - # with setattr - with self.assertRaises(AttributeError): - setattr(fruit, 'invalid_variable', 'some value') - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] # with getattr # Per Python doc, if the named attribute does not exist, # default is returned if provided. @@ -89,10 +95,28 @@ class TestFruit(unittest.TestCase): self.assertEqual(fruit.get('cultivar'), None) self.assertEqual(fruit.get('cultivar', 'some value'), 'some value') - # Per Python doc, if the named attribute does not exist, - # default is returned if provided, otherwise AttributeError is raised. - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') + def test_banana_fruit(self): + """Test Fruit""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + fruit = Fruit(length_cm=self.length_cm, color=self.color) + # check its properties + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(fruit.get('length_cm'), self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + self.assertEqual(fruit.color, self.color) + self.assertEqual(fruit['color'], self.color) + self.assertEqual(getattr(fruit, 'color'), self.color) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'length_cm': self.length_cm, + 'color': self.color + } + ) # make sure that the ModelComposed class properties are correct # model._composed_schemas stores the anyOf/allOf/oneOf info @@ -109,6 +133,7 @@ class TestFruit(unittest.TestCase): ) # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas + self.assertEqual(len(fruit._composed_instances), 1) for composed_instance in fruit._composed_instances: if composed_instance.__class__ == banana.Banana: banana_instance = composed_instance @@ -118,19 +143,16 @@ class TestFruit(unittest.TestCase): ) # model._var_name_to_model_instances maps the variable name to the # model instances which store that variable + print(fruit._var_name_to_model_instances) self.assertEqual( fruit._var_name_to_model_instances, { - 'color': [fruit], + 'color': [fruit, banana_instance], 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit], - 'origin': [fruit], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) # if we modify one of the properties owned by multiple @@ -140,21 +162,15 @@ class TestFruit(unittest.TestCase): with self.assertRaises(petstore_api.ApiValueError): some_length_cm = fruit.length_cm - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - fruit = Fruit( - color=color, - length_cm=length_cm, - unknown_property='some value' - ) - # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): fruit = Fruit( - length_cm=length_cm, + length_cm=self.length_cm, cultivar='granny smith' ) + def test_apple_fruit(self): + # make an instance of Fruit, a composed schema oneOf model # apple test color = 'red' @@ -190,19 +206,15 @@ class TestFruit(unittest.TestCase): self.assertEqual( fruit._var_name_to_model_instances, { - 'color': [fruit], - 'length_cm': [fruit], + 'color': [fruit, apple_instance], 'cultivar': [fruit, apple_instance], - 'origin': [fruit, apple_instance], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) - def testFruitNullValue(self): + def test_null_fruit(self): # Since 'apple' is nullable, validate we can create an apple with the 'null' value. fruit = apple.Apple(None) self.assertIsNone(fruit) @@ -220,5 +232,16 @@ class TestFruit(unittest.TestCase): fruit = Fruit(apple.Apple(None)) self.assertIsNone(fruit) + def test_fruit_with_invalid_input_type(self): + + """ + color must be a str, color's str type is only defined at the Fruit level + Banana + Apple would allow color to be assigned with any type of value + """ + invalid_value = 1 + with self.assertRaises(petstore_api.ApiTypeError): + fruit = Fruit(color=invalid_value, length_cm=self.length_cm) + + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py index 3e637c3226a0ee8f9d927953c693f62c5c800060..64b710fdd583ac4ea22b1b1eb0dd5e519dc11e0e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py @@ -14,21 +14,14 @@ import sys import unittest import petstore_api -try: - from petstore_api.model import apple_req -except ImportError: - apple_req = sys.modules[ - 'petstore_api.model.apple_req'] -try: - from petstore_api.model import banana_req -except ImportError: - banana_req = sys.modules[ - 'petstore_api.model.banana_req'] +from petstore_api.model import apple_req +from petstore_api.model import banana_req from petstore_api.model.fruit_req import FruitReq class TestFruitReq(unittest.TestCase): """FruitReq unit test stubs""" + length_cm = 20.3 def setUp(self): pass @@ -36,24 +29,9 @@ class TestFruitReq(unittest.TestCase): def tearDown(self): pass - def testFruitReq(self): - """Test FruitReq""" + def test_fruit_access_errors(self): + fruit = FruitReq(length_cm=self.length_cm) - # make an instance of Fruit, a composed schema oneOf model - # banana test - length_cm = 20.3 - fruit = FruitReq(length_cm=length_cm) - # check its properties - self.assertEqual(fruit.length_cm, length_cm) - self.assertEqual(fruit['length_cm'], length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), length_cm) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'length_cm': length_cm, - } - ) # setting a value that doesn't exist raises an exception # with a key with self.assertRaises(AttributeError): @@ -66,12 +44,31 @@ class TestFruitReq(unittest.TestCase): # with a key with self.assertRaises(AttributeError): invalid_variable = fruit['cultivar'] - # with getattr - self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') with self.assertRaises(AttributeError): getattr(fruit, 'cultivar') + def test_FruitReq_banana(self): + """Test FruitReq""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + fruit = FruitReq(length_cm=self.length_cm) + # check its properties + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'length_cm': self.length_cm, + } + ) + + # with getattr + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + # make sure that the ModelComposed class properties are correct # model._composed_schemas stores the anyOf/allOf/oneOf info self.assertEqual( @@ -101,15 +98,10 @@ class TestFruitReq(unittest.TestCase): fruit._var_name_to_model_instances, { 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit], - 'mealy': [fruit], - 'sweet': [fruit, banana_instance], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) # if we modify one of the properties owned by multiple @@ -119,21 +111,24 @@ class TestFruitReq(unittest.TestCase): with self.assertRaises(petstore_api.ApiValueError): some_length_cm = fruit.length_cm + def test_invalid_inputs(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): fruit = FruitReq( - length_cm=length_cm, + length_cm=self.length_cm, unknown_property='some value' ) # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): fruit = FruitReq( - length_cm=length_cm, + length_cm=self.length_cm, cultivar='granny smith' ) - # make an instance of Fruit, a composed schema oneOf model + def test_FruitReq_apple(self): + """Test FruitReq""" + # apple test cultivar = 'golden delicious' fruit = FruitReq(cultivar=cultivar) @@ -163,21 +158,18 @@ class TestFruitReq(unittest.TestCase): self.assertEqual( fruit._var_name_to_model_instances, { - 'length_cm': [fruit], 'cultivar': [fruit, apple_instance], - 'mealy': [fruit, apple_instance], - 'sweet': [fruit], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) + def test_null_fruit(self): # we can pass in None fruit = FruitReq(None) assert fruit is None + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py index 85d0fcf9b1c78b608b6b120154f2fe905e136956..ad5907ee44368d94ddd743a143e9b8b131093457 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py @@ -14,21 +14,15 @@ import sys import unittest import petstore_api -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] +from petstore_api.model import apple +from petstore_api.model import banana from petstore_api.model.gm_fruit import GmFruit class TestGmFruit(unittest.TestCase): """GmFruit unit test stubs""" + length_cm = 20.3 + color = 'yellow' def setUp(self): pass @@ -36,36 +30,48 @@ class TestGmFruit(unittest.TestCase): def tearDown(self): pass - def testGmFruit(self): + def test_set_addprop_attributes(self): + # setting a value that doesn't exist works because additional_properties_type allows any type + other_fruit = GmFruit(length_cm=self.length_cm, color=self.color) + blah = 'blah' + other_fruit['a'] = blah + assert other_fruit.a == blah + + # with setattr + setattr(other_fruit, 'b', blah) + assert other_fruit.b == blah + + self.assertEqual( + other_fruit.to_dict(), + { + 'a': 'blah', + 'b': 'blah', + 'length_cm': self.length_cm, + 'color': self.color + } + ) + + def test_banana_fruit(self): """Test GmFruit""" # make an instance of GmFruit, a composed schema anyOf model # banana test - length_cm = 20.3 - color = 'yellow' - fruit = GmFruit(length_cm=length_cm, color=color) + fruit = GmFruit(length_cm=self.length_cm, color=self.color) # check its properties - self.assertEqual(fruit.length_cm, length_cm) - self.assertEqual(fruit['length_cm'], length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), length_cm) - self.assertEqual(fruit.color, color) - self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + self.assertEqual(fruit.color, self.color) + self.assertEqual(fruit['color'], self.color) + self.assertEqual(getattr(fruit, 'color'), self.color) # check the dict representation self.assertEqual( fruit.to_dict(), { - 'length_cm': length_cm, - 'color': color + 'length_cm': self.length_cm, + 'color': self.color } ) - # setting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - fruit['invalid_variable'] = 'some value' - # with setattr - with self.assertRaises(AttributeError): - setattr(fruit, 'invalid_variable', 'some value') # getting a value that doesn't exist raises an exception # with a key @@ -104,40 +110,22 @@ class TestGmFruit(unittest.TestCase): self.assertEqual( fruit._var_name_to_model_instances, { - 'color': [fruit], + 'color': [fruit, banana_instance], 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit], - 'origin': [fruit], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - banana_instance.length_cm = 4.56 - with self.assertRaises(petstore_api.ApiValueError): - some_length_cm = fruit.length_cm - - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - fruit = GmFruit( - color=color, - length_cm=length_cm, - unknown_property='some value' - ) - + def test_combo_fruit(self): # including input parameters for both anyOf instances works cultivar = 'banaple' color = 'orange' fruit = GmFruit( color=color, cultivar=cultivar, - length_cm=length_cm + length_cm=self.length_cm ) self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) @@ -145,9 +133,9 @@ class TestGmFruit(unittest.TestCase): self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - self.assertEqual(fruit.length_cm, length_cm) - self.assertEqual(fruit['length_cm'], length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), length_cm) + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas @@ -165,14 +153,16 @@ class TestGmFruit(unittest.TestCase): self.assertEqual( fruit._var_name_to_model_instances, { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit, apple_instance], - 'origin': [fruit, apple_instance], + 'color': [fruit, apple_instance, banana_instance], + 'length_cm': [fruit, apple_instance, banana_instance], + 'cultivar': [fruit, apple_instance, banana_instance], } ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) - # make an instance of GmFruit, a composed schema anyOf model + def test_apple_fruit(self): # apple test color = 'red' cultivar = 'golden delicious' @@ -214,16 +204,13 @@ class TestGmFruit(unittest.TestCase): self.assertEqual( fruit._var_name_to_model_instances, { - 'color': [fruit], - 'length_cm': [fruit], + 'color': [fruit, apple_instance], 'cultivar': [fruit, apple_instance], 'origin': [fruit, apple_instance], } ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None self.assertEqual( - fruit._additional_properties_model_instances, [] + fruit._additional_properties_model_instances, [fruit] ) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_tag.py b/samples/openapi3/client/petstore/python/tests_manual/test_tag.py new file mode 100644 index 0000000000000000000000000000000000000000..ec945f6b30b859b61fe1234be40acefe26f36b4f --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_tag.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.tag import Tag + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_can_ingest_additional_properties_in_tag(self): + t = Tag(a='abc') + assert t.a == 'abc' + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/ktorm/.openapi-generator/VERSION b/samples/schema/petstore/ktorm/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/schema/petstore/ktorm/.openapi-generator/VERSION +++ b/samples/schema/petstore/ktorm/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index d9a363a1cccef94f2dd9247b8454adc1171910e4..0312e13cdf7c134f745ca5611ea2809dc4eed4f2 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,12 +2,12 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 5.1.1. +Generated by OpenAPI Generator 5.2.0-SNAPSHOT. ## Requires -* Kotlin 1.3.21 -* Gradle 4.9 +* Kotlin 1.4.31 +* Gradle 6.8.2 ## Build diff --git a/samples/server/petstore/kotlin-server/ktor/build.gradle b/samples/server/petstore/kotlin-server/ktor/build.gradle index 25536d4e5316e8d4c667afe7385e80722ee0d85f..c69f129160f566ffb06f82abd949b2f459a4eb9c 100644 --- a/samples/server/petstore/kotlin-server/ktor/build.gradle +++ b/samples/server/petstore/kotlin-server/ktor/build.gradle @@ -2,13 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '4.9' + gradleVersion = '6.8.2' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.3.21' - ext.ktor_version = '1.1.3' + ext.kotlin_version = '1.4.31' + ext.ktor_version = '1.5.2' ext.shadow_version = '2.0.3' repositories { @@ -29,7 +29,7 @@ apply plugin: 'application' mainClassName = "io.ktor.server.netty.DevelopmentEngine" -// Initialization order with shadow 2.0.1 and Gradle 4.3 is weird. +// Initialization order with shadow 2.0.1 and Gradle 6.8.2 is weird. // See https://github.com/johnrengelman/shadow/issues/336#issuecomment-355402508 apply plugin: 'com.github.johnrengelman.shadow' @@ -59,6 +59,7 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "io.ktor:ktor-server-netty:$ktor_version" compile "io.ktor:ktor-metrics:$ktor_version" + compile "io.ktor:ktor-auth:$ktor_version" compile "io.ktor:ktor-locations:$ktor_version" compile "io.ktor:ktor-gson:$ktor_version" compile "io.ktor:ktor-client-core:$ktor_version" diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/AppMain.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/AppMain.kt index 2b0cd5cdb5fd2ee70393b1c03afe1fa83d3e904c..54658d6ba5df78949cbf582f8e36d7e308888f40 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/AppMain.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/AppMain.kt @@ -18,12 +18,11 @@ import io.ktor.gson.GsonConverter import io.ktor.http.ContentType import io.ktor.locations.KtorExperimentalLocationsAPI import io.ktor.locations.Locations -import io.ktor.metrics.Metrics import io.ktor.routing.Routing import java.util.concurrent.TimeUnit -import io.ktor.util.KtorExperimentalAPI import io.ktor.auth.Authentication import io.ktor.auth.oauth +import io.ktor.metrics.dropwizard.DropwizardMetrics import org.openapitools.server.infrastructure.ApiKeyCredential import org.openapitools.server.infrastructure.ApiPrincipal import org.openapitools.server.infrastructure.apiKeyAuth @@ -32,23 +31,21 @@ import org.openapitools.server.apis.StoreApi import org.openapitools.server.apis.UserApi -@KtorExperimentalAPI internal val settings = HoconApplicationConfig(ConfigFactory.defaultApplication(HTTP::class.java.classLoader)) object HTTP { val client = HttpClient(Apache) } -@KtorExperimentalAPI @KtorExperimentalLocationsAPI fun Application.main() { install(DefaultHeaders) - install(Metrics) { + install(DropwizardMetrics) { val reporter = Slf4jReporter.forRegistry(registry) - .outputTo(log) - .convertRatesTo(TimeUnit.SECONDS) - .convertDurationsTo(TimeUnit.MILLISECONDS) - .build() + .outputTo(log) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build() reporter.start(10, TimeUnit.SECONDS) } install(ContentNegotiation) { @@ -72,8 +69,8 @@ fun Application.main() { client = HttpClient(Apache) providerLookup = { ApplicationAuthProviders["petstore_auth"] } urlProvider = { _ -> - // TODO: define a callback url here. - "/" + // TODO: define a callback url here. + "/" } } } @@ -84,8 +81,7 @@ fun Application.main() { } - environment.monitor.subscribe(ApplicationStopping) - { + environment.monitor.subscribe(ApplicationStopping) { HTTP.client.close() } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Configuration.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Configuration.kt index c16a32ef70f03e36178702a940b9d574a2b25a2a..8483e64319d09ab58d77e30856fa250f923063bf 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Configuration.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Configuration.kt @@ -8,11 +8,7 @@ import io.ktor.features.deflate import io.ktor.features.gzip import io.ktor.features.minimumSize import io.ktor.http.HttpMethod -import io.ktor.util.KtorExperimentalAPI -import java.time.Duration -import java.util.concurrent.Executors - -import org.openapitools.server.settings +import java.util.concurrent.TimeUnit /** @@ -25,7 +21,7 @@ import org.openapitools.server.settings */ internal fun ApplicationHstsConfiguration(): HSTS.Configuration.() -> Unit { return { - maxAge = Duration.ofDays(365) + maxAgeInSeconds = TimeUnit.DAYS.toSeconds(365) includeSubDomains = true preload = false @@ -55,7 +51,6 @@ internal fun ApplicationCompressionConfiguration(): Compression.Configuration.() } // Defines authentication mechanisms used throughout the application. -@KtorExperimentalAPI val ApplicationAuthProviders: Map<String, OAuthServerSettings> = listOf<OAuthServerSettings>( OAuthServerSettings.OAuth2ServerSettings( name = "petstore_auth", @@ -77,6 +72,3 @@ val ApplicationAuthProviders: Map<String, OAuthServerSettings> = listOf<OAuthSer // defaultScopes = listOf("public_profile") // ) ).associateBy { it.name } - -// Provides an application-level fixed thread pool on which to execute coroutines (mainly) -internal val ApplicationExecutors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4) diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Paths.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Paths.kt index 1983ab78a49d3dbb24f06f435aaaf9f408fc589a..26004e999a2a42b40850d5e267cfce5205a88a9d 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Paths.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/Paths.kt @@ -13,8 +13,17 @@ package org.openapitools.server import io.ktor.locations.KtorExperimentalLocationsAPI import io.ktor.locations.Location +import org.openapitools.server.models.* object Paths { + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + */ + @KtorExperimentalLocationsAPI + @Location("/pet") class addPet(val body: Pet) + /** * Deletes a pet * @@ -30,7 +39,7 @@ object Paths { * @param status Status values that need to be considered for filter */ @KtorExperimentalLocationsAPI - @Location("/pet/findByStatus") class findPetsByStatus(val status: kotlin.Array<kotlin.String>) + @Location("/pet/findByStatus") class findPetsByStatus(val status: kotlin.collections.List<kotlin.String>) /** * Finds Pets by tags @@ -38,7 +47,7 @@ object Paths { * @param tags Tags to filter by */ @KtorExperimentalLocationsAPI - @Location("/pet/findByTags") class findPetsByTags(val tags: kotlin.Array<kotlin.String>) + @Location("/pet/findByTags") class findPetsByTags(val tags: kotlin.collections.List<kotlin.String>) /** * Find pet by ID @@ -48,6 +57,34 @@ object Paths { @KtorExperimentalLocationsAPI @Location("/pet/{petId}") class getPetById(val petId: kotlin.Long) + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + */ + @KtorExperimentalLocationsAPI + @Location("/pet") class updatePet(val body: Pet) + + /** + * 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) + */ + @KtorExperimentalLocationsAPI + @Location("/pet/{petId}") class updatePetWithForm(val petId: kotlin.Long, val name: kotlin.String? = null, val status: kotlin.String? = null) + + /** + * 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) + */ + @KtorExperimentalLocationsAPI + @Location("/pet/{petId}/uploadImage") class uploadFile(val petId: kotlin.Long, val additionalMetadata: kotlin.String? = null, val file: java.io.File? = null) + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -71,6 +108,38 @@ object Paths { @KtorExperimentalLocationsAPI @Location("/store/order/{orderId}") class getOrderById(val orderId: kotlin.Long) + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + */ + @KtorExperimentalLocationsAPI + @Location("/store/order") class placeOrder(val body: Order) + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + */ + @KtorExperimentalLocationsAPI + @Location("/user") class createUser(val body: User) + + /** + * Creates list of users with given input array + * + * @param body List of user object + */ + @KtorExperimentalLocationsAPI + @Location("/user/createWithArray") class createUsersWithArrayInput(val body: kotlin.collections.List<User>) + + /** + * Creates list of users with given input array + * + * @param body List of user object + */ + @KtorExperimentalLocationsAPI + @Location("/user/createWithList") class createUsersWithListInput(val body: kotlin.collections.List<User>) + /** * Delete user * This can only be done by the logged in user. @@ -103,4 +172,13 @@ object Paths { @KtorExperimentalLocationsAPI @Location("/user/logout") class logoutUser() + /** + * 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 + */ + @KtorExperimentalLocationsAPI + @Location("/user/{username}") class updateUser(val username: kotlin.String, val body: User) + } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt index 3ac3578638d5dab22f8840a8161739cf3163cac3..9226541eb34ec53c501e35d6835d1bff2931c20d 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -20,17 +20,18 @@ import io.ktor.auth.OAuthAccessTokenResponse import io.ktor.auth.OAuthServerSettings import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get import io.ktor.response.respond import io.ktor.response.respondText import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - import org.openapitools.server.Paths +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.locations.post +import io.ktor.locations.put +import io.ktor.locations.options +import io.ktor.locations.head + import org.openapitools.server.infrastructure.ApiPrincipal @@ -41,40 +42,27 @@ import org.openapitools.server.models.Pet fun Route.PetApi() { val gson = Gson() val empty = mutableMapOf<String, Any?>() - - route("/pet") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal<OAuthAccessTokenResponse>() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } + authenticate("petstore_auth") { + post<Paths.addPet> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! + + call.respond(HttpStatusCode.NotImplemented) + } } - - delete<Paths.deletePet> { _: Paths.deletePet -> - val principal = call.authentication.principal<OAuthAccessTokenResponse>() + authenticate("petstore_auth") { + delete<Paths.deletePet> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } + call.respond(HttpStatusCode.NotImplemented) + } } - - get<Paths.findPetsByStatus> { _: Paths.findPetsByStatus -> - val principal = call.authentication.principal<OAuthAccessTokenResponse>() + authenticate("petstore_auth") { + get<Paths.findPetsByStatus> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -93,22 +81,19 @@ fun Route.PetApi() { "status" : "available" }""" - when(exampleContentType) { + when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) } - } + } } - - get<Paths.findPetsByTags> { _: Paths.findPetsByTags -> - val principal = call.authentication.principal<OAuthAccessTokenResponse>() + authenticate("petstore_auth") { + get<Paths.findPetsByTags> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -127,22 +112,19 @@ fun Route.PetApi() { "status" : "available" }""" - when(exampleContentType) { + when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) } - } + } } - - get<Paths.getPetById> { _: Paths.getPetById -> - val principal = call.authentication.principal<ApiPrincipal>() + authenticate("api_key") { + get<Paths.getPetById> { + val principal = call.authentication.principal<ApiPrincipal>()!! - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -161,68 +143,47 @@ fun Route.PetApi() { "status" : "available" }""" - when(exampleContentType) { + when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) } - } } - - - route("/pet") { - authenticate("petstore_auth") { - put { - val principal = call.authentication.principal<OAuthAccessTokenResponse>() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } } - - route("/pet/{petId}") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal<OAuthAccessTokenResponse>() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } + authenticate("petstore_auth") { + put<Paths.updatePet> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! + + call.respond(HttpStatusCode.NotImplemented) + } } + authenticate("petstore_auth") { + post<Paths.updatePetWithForm> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! + + call.respond(HttpStatusCode.NotImplemented) + } + } - route("/pet/{petId}/uploadImage") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal<OAuthAccessTokenResponse>() + authenticate("petstore_auth") { + post<Paths.uploadFile> { + val principal = call.authentication.principal<OAuthAccessTokenResponse>()!! + + val exampleContentType = "application/json" + val exampleContentString = """{ + "code" : 0, + "type" : "type", + "message" : "message" + }""" - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" - val exampleContentString = """{ - "code" : 0, - "type" : "type", - "message" : "message" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } + when (exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) } } + } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt index 17b2c526bd9ca800eedb6aed426629dc2f987518..2e5f4ab8b96cbc794f4506f3db9c6118e0ab1ba6 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt @@ -20,17 +20,18 @@ import io.ktor.auth.OAuthAccessTokenResponse import io.ktor.auth.OAuthServerSettings import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get import io.ktor.response.respond import io.ktor.response.respondText import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - import org.openapitools.server.Paths +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.locations.post +import io.ktor.locations.put +import io.ktor.locations.options +import io.ktor.locations.head + import org.openapitools.server.infrastructure.ApiPrincipal @@ -40,24 +41,19 @@ import org.openapitools.server.models.Order fun Route.StoreApi() { val gson = Gson() val empty = mutableMapOf<String, Any?>() - - delete<Paths.deleteOrder> { _: Paths.deleteOrder -> + delete<Paths.deleteOrder> { call.respond(HttpStatusCode.NotImplemented) } - - get<Paths.getInventory> { _: Paths.getInventory -> - val principal = call.authentication.principal<ApiPrincipal>() + authenticate("api_key") { + get<Paths.getInventory> { + val principal = call.authentication.principal<ApiPrincipal>()!! - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } + call.respond(HttpStatusCode.NotImplemented) + } } - - get<Paths.getOrderById> { _: Paths.getOrderById -> + get<Paths.getOrderById> { val exampleContentType = "application/json" val exampleContentString = """{ "petId" : 6, @@ -68,31 +64,28 @@ fun Route.StoreApi() { "status" : "placed" }""" - when(exampleContentType) { + when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) } } - - route("/store/order") { - post { - val exampleContentType = "application/json" - val exampleContentString = """{ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } + post<Paths.placeOrder> { + val exampleContentType = "application/json" + val exampleContentString = """{ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }""" + + when (exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt index 7fc0b78fa995672f37e9befe586b9f397a5482b5..e248d75ae0ccdc4bed39a46977af9b70034f931f 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt @@ -20,17 +20,18 @@ import io.ktor.auth.OAuthAccessTokenResponse import io.ktor.auth.OAuthServerSettings import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get import io.ktor.response.respond import io.ktor.response.respondText import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - import org.openapitools.server.Paths +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.locations.post +import io.ktor.locations.put +import io.ktor.locations.options +import io.ktor.locations.head + import org.openapitools.server.infrastructure.ApiPrincipal @@ -40,34 +41,23 @@ import org.openapitools.server.models.User fun Route.UserApi() { val gson = Gson() val empty = mutableMapOf<String, Any?>() - - route("/user") { - post { - call.respond(HttpStatusCode.NotImplemented) - } + post<Paths.createUser> { + call.respond(HttpStatusCode.NotImplemented) } - - route("/user/createWithArray") { - post { - call.respond(HttpStatusCode.NotImplemented) - } + post<Paths.createUsersWithArrayInput> { + call.respond(HttpStatusCode.NotImplemented) } - - route("/user/createWithList") { - post { - call.respond(HttpStatusCode.NotImplemented) - } + post<Paths.createUsersWithListInput> { + call.respond(HttpStatusCode.NotImplemented) } - - delete<Paths.deleteUser> { _: Paths.deleteUser -> + delete<Paths.deleteUser> { call.respond(HttpStatusCode.NotImplemented) } - - get<Paths.getUserByName> { _: Paths.getUserByName -> + get<Paths.getUserByName> { val exampleContentType = "application/json" val exampleContentString = """{ "firstName" : "firstName", @@ -80,28 +70,23 @@ fun Route.UserApi() { "username" : "username" }""" - when(exampleContentType) { + when (exampleContentType) { "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) else -> call.respondText(exampleContentString) } } - - get<Paths.loginUser> { _: Paths.loginUser -> + get<Paths.loginUser> { call.respond(HttpStatusCode.NotImplemented) } - - get<Paths.logoutUser> { _: Paths.logoutUser -> + get<Paths.logoutUser> { call.respond(HttpStatusCode.NotImplemented) } - - route("/user/{username}") { - put { - call.respond(HttpStatusCode.NotImplemented) - } + put<Paths.updateUser> { + call.respond(HttpStatusCode.NotImplemented) } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt index 8de972967ef3d6420936bfb366ed1b228b836164..de09ba8b6b6205353ed38249fd0744523704b6d7 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt @@ -1,85 +1,105 @@ package org.openapitools.server.infrastructure -import io.ktor.application.ApplicationCall -import io.ktor.application.call -import io.ktor.auth.Authentication -import io.ktor.auth.AuthenticationFailedCause -import io.ktor.auth.AuthenticationPipeline -import io.ktor.auth.AuthenticationProvider -import io.ktor.auth.Credential -import io.ktor.auth.Principal -import io.ktor.auth.UnauthorizedResponse -import io.ktor.http.auth.HeaderValueEncoding -import io.ktor.http.auth.HttpAuthHeader -import io.ktor.request.ApplicationRequest -import io.ktor.response.respond +import io.ktor.application.* +import io.ktor.auth.* +import io.ktor.http.auth.* +import io.ktor.request.* +import io.ktor.response.* enum class ApiKeyLocation(val location: String) { QUERY("query"), HEADER("header") } -data class ApiKeyCredential(val value: String): Credential -data class ApiPrincipal(val apiKeyCredential: ApiKeyCredential?) : Principal - +data class ApiKeyCredential(val value: String) : Credential +data class ApiPrincipal(val apiKeyCredential: ApiKeyCredential?) : Principal /** * Represents a Api Key authentication provider * @param name is the name of the provider, or `null` for a default provider */ -class ApiKeyAuthenticationProvider(name: String?) : AuthenticationProvider(name) { - internal var authenticationFunction: suspend ApplicationCall.(ApiKeyCredential) -> Principal? = { null } +class ApiKeyAuthenticationProvider(configuration: Configuration) : AuthenticationProvider(configuration) { - var apiKeyName: String = ""; + private val authenticationFunction = configuration.authenticationFunction - var apiKeyLocation: ApiKeyLocation = ApiKeyLocation.QUERY; + private val apiKeyName: String = configuration.apiKeyName - /** - * Sets a validation function that will check given [ApiKeyCredential] instance and return [Principal], - * or null if credential does not correspond to an authenticated principal - */ - fun validate(body: suspend ApplicationCall.(ApiKeyCredential) -> Principal?) { - authenticationFunction = body - } -} + private val apiKeyLocation: ApiKeyLocation = configuration.apiKeyLocation -fun Authentication.Configuration.apiKeyAuth(name: String? = null, configure: ApiKeyAuthenticationProvider.() -> Unit) { - val provider = ApiKeyAuthenticationProvider(name).apply(configure) - val apiKeyName = provider.apiKeyName - val apiKeyLocation = provider.apiKeyLocation - val authenticate = provider.authenticationFunction + internal fun install() { + pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> + val credentials = call.request.apiKeyAuthenticationCredentials(apiKeyName, apiKeyLocation) + val principal = credentials?.let { authenticationFunction(call, it) } - provider.pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> - val credentials = call.request.apiKeyAuthenticationCredentials(apiKeyName, apiKeyLocation) - val principal = credentials?.let { authenticate(call, it) } + val cause = when { + credentials == null -> AuthenticationFailedCause.NoCredentials + principal == null -> AuthenticationFailedCause.InvalidCredentials + else -> null + } - val cause = when { - credentials == null -> AuthenticationFailedCause.NoCredentials - principal == null -> AuthenticationFailedCause.InvalidCredentials - else -> null - } + if (cause != null) { + context.challenge(apiKeyName, cause) { + call.respond( + UnauthorizedResponse( + HttpAuthHeader.Parameterized( + "API_KEY", + mapOf("key" to apiKeyName), + HeaderValueEncoding.QUOTED_ALWAYS + ) + ) + ) + it.complete() + } + } - if (cause != null) { - context.challenge(apiKeyName, cause) { - // TODO: Verify correct response structure here. - call.respond(UnauthorizedResponse(HttpAuthHeader.Parameterized("API_KEY", mapOf("key" to apiKeyName), HeaderValueEncoding.QUOTED_ALWAYS))) - it.complete() + if (principal != null) { + context.principal(principal) } } + } + + class Configuration internal constructor(name: String?) : AuthenticationProvider.Configuration(name) { + + internal var authenticationFunction: suspend ApplicationCall.(ApiKeyCredential) -> Principal? = { + throw NotImplementedError( + "Api Key auth validate function is not specified. Use apiKeyAuth { validate { ... } } to fix." + ) + } - if (principal != null) { - context.principal(principal) + var apiKeyName: String = "" + + var apiKeyLocation: ApiKeyLocation = ApiKeyLocation.QUERY + + /** + * Sets a validation function that will check given [ApiKeyCredential] instance and return [Principal], + * or null if credential does not correspond to an authenticated principal + */ + fun validate(body: suspend ApplicationCall.(ApiKeyCredential) -> Principal?) { + authenticationFunction = body } } } -fun ApplicationRequest.apiKeyAuthenticationCredentials(apiKeyName: String, apiKeyLocation: ApiKeyLocation): ApiKeyCredential? { - val value: String? = when(apiKeyLocation) { +fun Authentication.Configuration.apiKeyAuth( + name: String? = null, + configure: ApiKeyAuthenticationProvider.Configuration.() -> Unit +) { + val configuration = ApiKeyAuthenticationProvider.Configuration(name).apply(configure) + val provider = ApiKeyAuthenticationProvider(configuration) + provider.install() + register(provider) +} + +fun ApplicationRequest.apiKeyAuthenticationCredentials( + apiKeyName: String, + apiKeyLocation: ApiKeyLocation +): ApiKeyCredential? { + val value: String? = when (apiKeyLocation) { ApiKeyLocation.QUERY -> this.queryParameters[apiKeyName] ApiKeyLocation.HEADER -> this.headers[apiKeyName] } - when (value) { - null -> return null - else -> return ApiKeyCredential(value) + return when (value) { + null -> null + else -> ApiKeyCredential(value) } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt index 45760790990985921a81e4bbea020ab181fa55c5..14f50dbb9ad618c2c5e1d92c72a660cd05ef7cba 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt @@ -19,7 +19,7 @@ import java.io.Serializable * @param type * @param message */ -data class ApiResponse ( +data class ApiResponse( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt index ee26d4c76e50aadd81a51360dcf764371bac220c..9d85719213842756759dc03cc465b72d50a1c612 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -18,7 +18,7 @@ import java.io.Serializable * @param id * @param name */ -data class Category ( +data class Category( val id: kotlin.Long? = null, val name: kotlin.String? = null ) : Serializable diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt index 7889abe12ee2297ac45d885acf9c003ffa43e08c..5e9e18b0328cda27c8a8b1e65f9ee602f65de8c4 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -22,7 +22,7 @@ import java.io.Serializable * @param status Order Status * @param complete */ -data class Order ( +data class Order( val id: kotlin.Long? = null, val petId: kotlin.Long? = null, val quantity: kotlin.Int? = null, diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt index 8dc13b7ea6e254a946a8f8267d2bb720bb635909..8b98ce0469c52bdfecd14cd173549d933e154911 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -24,12 +24,12 @@ import java.io.Serializable * @param tags * @param status pet status in the store */ -data class Pet ( +data class Pet( val name: kotlin.String, - val photoUrls: kotlin.Array<kotlin.String>, + val photoUrls: kotlin.collections.List<kotlin.String>, val id: kotlin.Long? = null, val category: Category? = null, - val tags: kotlin.Array<Tag>? = null, + val tags: kotlin.collections.List<Tag>? = null, /* pet status in the store */ val status: Pet.Status? = null ) : Serializable diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt index 49c2887a5039720208bcab411a7a7bf58ab7d4ea..e9626b25c6d1550486729178087631ba049bbc0b 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -18,7 +18,7 @@ import java.io.Serializable * @param id * @param name */ -data class Tag ( +data class Tag( val id: kotlin.Long? = null, val name: kotlin.String? = null ) : Serializable diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt index dee8de740bdeef044940ce24789acb23afef96a0..fdbdb4e1cff4090de91612d588d86a98e1679ac4 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt @@ -24,7 +24,7 @@ import java.io.Serializable * @param phone * @param userStatus User Status */ -data class User ( +data class User( val id: kotlin.Long? = null, val username: kotlin.String? = null, val firstName: kotlin.String? = null, diff --git a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 10a19f58d0583bf8b71172110074303eb6f8bbec..2880b39b990d7c6b2928dc2b68922c09088a42e4 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 88b02becf938a560991ec699282ca939abfeae59..14a9d0fa525d9d2547610d9644bddd4b1cff4d1c 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 9fa0622ad70e2bf16652de190333e41b099995a6..233a3bb1a5f21979e24357532a80abab3a43671c 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 7f0928183420a4bbb6aca30f322a2bd8d47dfc06..2d31a64a04d4611f58e3b6d0870ae66c2b023407 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2f99283ef45eae9361e035fe9302941ba463a85b..a3f907809a0018178bbf8f7664f7f8a6b076778b 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 a2037e5fe8680d853c65c583c3d85dfa49b7c1a5..8326ab48c02cfb8559c7c70527308a7dc4975623 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 778d4f1be395f824eba1914d629d2c1e0b9c1b63..b301ad0b4855dda813b11290aa6bc3af495d112a 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b70d43c328e9996b7dd17080f9f7bd7ee79b17b6..3de6e0e21889bed045b1d3e5e6c5da6153dbfe85 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 22fbc9958bd484d368cf7b667828ab84acf6d32c..f2512f9eac347dc56051ba63b5b2c130b93863f8 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 319f706fb5d8672e3cf5225be637a12daf91287f..03fa53219d908c9391e38bef99fd8f83e1d9ed1a 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 7db39677ba7e436e9898b873de6b1c8091ada674..bc349aa67c0f18cb0a9bfea74bd3a5ac3a9f2af6 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f43feafd0652070b4687a2bc1b19fbb30bc77d79..1d52ff9cf8878888eb4625b3f455decabef4b185 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e55f761c2c91f377408cf6b336a497ebc61be847..6c50971728c1588337815ca3b115fa142fc6f792 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f33e950abe66d678a8a8d0217b5f6c0ef2276af5..9c17aee08e3d427b34fe481111b52518b7ee9a60 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e55f761c2c91f377408cf6b336a497ebc61be847..6c50971728c1588337815ca3b115fa142fc6f792 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 907b44a2e71d3d69ebd7171537f581b5ad61c29b..b0b57f815bd604ae2a9ad508f6c560cfec51d2cf 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 52062d995ab31e5e475a6afbc27de8ec0f971d56..2e67f9eb60995454db2c2bfedf20725c9190ba89 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f33e950abe66d678a8a8d0217b5f6c0ef2276af5..9c17aee08e3d427b34fe481111b52518b7ee9a60 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e55f761c2c91f377408cf6b336a497ebc61be847..6c50971728c1588337815ca3b115fa142fc6f792 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f370b93b41166f2e769b0149887c3af85ba6706a..dfae7d61930c6ab3e8374c4fd42950240285b8ed 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ead3bab5434f2c09f298093e20fc90e94f8bea36..68cec85a19ab5b29ce44e1fc22e6b6e75eabd4d8 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b4daf946f402b86a03706bcae6c79b6a905cce1a..d2215dd0d1be67a53145d853301939fe35dd171c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 4c6d443781b8e33252d90f90344c78b534be9bc9..b9655c2c700f2fce7287872658815006e62669b5 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 7f5bf19008a0b728de755ca065f23f72f3db591a..69c047f7c677ba41fe1982875d39f846e57c3a0b 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 47852ded8c9e81aaa7b449efc47853f8bb9984a1..972cc8bc46828bdd7a0757ce3007cdf2a4f65fc0 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f33e950abe66d678a8a8d0217b5f6c0ef2276af5..9c17aee08e3d427b34fe481111b52518b7ee9a60 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e55f761c2c91f377408cf6b336a497ebc61be847..6c50971728c1588337815ca3b115fa142fc6f792 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 5100938329c632b608a46d3096ff4ef9fb29b4a8..f4afb63f6185da36864ea2b03096c8e121745162 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 985c9ae6cb62f80528f5afb6a5fe3d8897d34529..f085be2317d2f05fb36e0ee931327653c6e2b988 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e1654342989ce41ea12d9f10e54919a539c6472e..572b49ba2a942b93ab46dc80017e2bc36c5daf64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5d51a962824eb63e7d82e9bfe49aa559fd68f05c..b7a84c916cfbe755a7c7e6592fad83161bffd8dd 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 757bd818f60d6d74ca4c7477243af6fcf9f2e016..05cfb8f5758ab933b8e38a754da653c9d9bf5789 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 66a0b7b59a4cc45ade04584dc87f2bd0180b7515..5b3512235937beb26d072d77f844bcc6d4548962 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 5100938329c632b608a46d3096ff4ef9fb29b4a8..f4afb63f6185da36864ea2b03096c8e121745162 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 985c9ae6cb62f80528f5afb6a5fe3d8897d34529..f085be2317d2f05fb36e0ee931327653c6e2b988 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e1654342989ce41ea12d9f10e54919a539c6472e..572b49ba2a942b93ab46dc80017e2bc36c5daf64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5d51a962824eb63e7d82e9bfe49aa559fd68f05c..b7a84c916cfbe755a7c7e6592fad83161bffd8dd 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 757bd818f60d6d74ca4c7477243af6fcf9f2e016..05cfb8f5758ab933b8e38a754da653c9d9bf5789 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 66a0b7b59a4cc45ade04584dc87f2bd0180b7515..5b3512235937beb26d072d77f844bcc6d4548962 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 def9e07d22c9e4bd549adb07a550be4549fb6030..0fa0742fe83a9ce351296c924e733d7b2d8373c8 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 9652c38fc9560d1731e16398efb9a4e5dfd0ed83..e985e37bc09edd9aa9ddc1437105d5390ab31a1e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b248d6cbde02213d7963a7c2b6dfc72f96f2418c..3d7f2e2ea285459912fbd7ddfa4992c585b3307f 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 4bb4d65097c9d3c1827cb8f6edec8972e138289b..209a72ff977834fb42a5dd7b0da1d87b016ec495 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0a715ba8561a5b36169133e32efa3d064638996c..94057aa6fc58f458c017268e64c5dc27cf5a79b9 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f2268686b16c7dbb594a94462cca5881f12644a4..b60e3580cf6b61c2e55e926708923f690f42bc33 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 03f98087f0ee9cfcfe8e5709f6be294e1285c866..eea35ce51b892e83ac13f009f831a74ae9332687 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 d0f55aa5f1473a1d5aebfd0fd1367b532267b2ab..33228158d4d3911654a5183db89dd1000b7ff5c2 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 06ee4efe9684eba29257b1198ead2206872bb5eb..15b48f22a526469eba9b2a749b410ec040c57daf 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 14dfbbba24f53e4bea0611e24cc949a9eeff9b6f..41ed1eeccd35158963afca7a456121cdf9989981 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 4ca60e5766e5cf582f45a8cd8c63ade38e8972ba..520c688e3fa4bf68435404d8662f3423846536bf 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 75ce75a9bd1038c98d485831e24bab7c892abc12..2f3e0a55c9bd4e9665f21b01f2155ed46c4732fa 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f370b93b41166f2e769b0149887c3af85ba6706a..dfae7d61930c6ab3e8374c4fd42950240285b8ed 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 83b272058047f84b5de40af10ed1b0dcd6e568e7..54e73fc876d02cddf6030f503676ec020cecfc2c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b4daf946f402b86a03706bcae6c79b6a905cce1a..d2215dd0d1be67a53145d853301939fe35dd171c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2f029cb7317d7a718be8091ad6388eba37cb9758..dcdb633acf621bd54054fe2dc65d4e82c12dac05 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 7f5bf19008a0b728de755ca065f23f72f3db591a..69c047f7c677ba41fe1982875d39f846e57c3a0b 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 47852ded8c9e81aaa7b449efc47853f8bb9984a1..972cc8bc46828bdd7a0757ce3007cdf2a4f65fc0 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 5100938329c632b608a46d3096ff4ef9fb29b4a8..f4afb63f6185da36864ea2b03096c8e121745162 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f536fb7fb770c2016f39db28fb1c84085dd33f9a..02a920c8bf8bd7ae8f073d0888a1a62ad85a8ba4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e1654342989ce41ea12d9f10e54919a539c6472e..572b49ba2a942b93ab46dc80017e2bc36c5daf64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 8d28ab3eb4bcd669f08108ecbd3af1ef90d6d6e5..0e5bdeffced3a8939214f408b6909946c20aba7c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 757bd818f60d6d74ca4c7477243af6fcf9f2e016..05cfb8f5758ab933b8e38a754da653c9d9bf5789 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 66a0b7b59a4cc45ade04584dc87f2bd0180b7515..5b3512235937beb26d072d77f844bcc6d4548962 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f370b93b41166f2e769b0149887c3af85ba6706a..dfae7d61930c6ab3e8374c4fd42950240285b8ed 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 83b272058047f84b5de40af10ed1b0dcd6e568e7..54e73fc876d02cddf6030f503676ec020cecfc2c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b4daf946f402b86a03706bcae6c79b6a905cce1a..d2215dd0d1be67a53145d853301939fe35dd171c 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2f029cb7317d7a718be8091ad6388eba37cb9758..dcdb633acf621bd54054fe2dc65d4e82c12dac05 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 7f5bf19008a0b728de755ca065f23f72f3db591a..69c047f7c677ba41fe1982875d39f846e57c3a0b 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 47852ded8c9e81aaa7b449efc47853f8bb9984a1..972cc8bc46828bdd7a0757ce3007cdf2a4f65fc0 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 907b44a2e71d3d69ebd7171537f581b5ad61c29b..b0b57f815bd604ae2a9ad508f6c560cfec51d2cf 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 52062d995ab31e5e475a6afbc27de8ec0f971d56..2e67f9eb60995454db2c2bfedf20725c9190ba89 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 54945f569836d287d0a1be23cba5557398f0010c..5360eef212b63ef24612c54b05c6de64ff6a5a35 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 d9126589b9dcd3605caaa1caf6ab73826c4c5a9f..581c9ec1d36fc0f4054f6651a92d6c2518e9a63d 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 398d524365781227962269bcb26f0d92f9eb8644..5ba806e0898feb22a25ee549abf0e270549f5116 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 9d9be5d431614efc931c035acf560c11aa20d90e..b3dcb0a940083fcd438719e4090478bc9b7c1b46 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 217abb586cbc7b3b13787d254cc9265598bb2a6a..a963e3199694fbdc64e23d838868b847c8a7d4d4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 4e28d22110c461ee0d7eff93441aa86c5d3403f3..a83c6d8326d25214825c5671e89e899e0c8fae70 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3ed5eaebc280ac8f582e30b61c07abae56ad0741..e9cd51627cd00044e0381f771dc7649c59572684 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 12aebcbe2f8e689c9aa27d6909f07c9f6cffae10..d730f7e2ab01a2c018028832e7d719d34e0e0633 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 3bff059174b83d43cdf93771ce441423e4284d88..6555596f931149bc73ff7b8c2d0ab3985c120e26 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0-SNAPSHOT \ No newline at end of file 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 f0b6db968e1a5472deeeb31198dc095ba13f8d6e..62b5e8c1c9ec82d4751b49b006a9a8e60dbfbb64 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f33e950abe66d678a8a8d0217b5f6c0ef2276af5..9c17aee08e3d427b34fe481111b52518b7ee9a60 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ad154f0e01bfe32e20095cce0487e8ff59027210..ce5242fa1b9338205a4d682c6990f8959c0823a4 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 e55f761c2c91f377408cf6b336a497ebc61be847..6c50971728c1588337815ca3b115fa142fc6f792 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3865fc906981cf647163429a0a6144cdea522739..a18ef08034178b0bbd5b3c864c8a00a7df22749e 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 0e60b7c2863535f89034cfba611ca3aa51709df7..bdd829c2178fc6f6781f81cc9650d1518a7988ab 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 @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */