Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 1623589

Browse files
authored
Merge pull request #6 from OpenAPITools/5-python-fails-to-deserialize-using-discriminator
Adds command line argument nonCompliantUseDiscriminatorIfCompositionFails
2 parents 8a1ce13 + 8fad9e5 commit 1623589

File tree

125 files changed

+6965
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+6965
-98
lines changed

CI/circle_parallel.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ elif [ "$NODE_INDEX" = "4" ]; then
6363
#mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
6464
(cd samples/openapi3/client/petstore/python && make test)
6565
(cd samples/openapi3/client/3_0_3_unit_test/python && make test)
66+
(cd samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python && make test)
6667

6768
else
6869
echo "Running node $NODE_INDEX"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
generatorName: python
2+
outputDir: samples/openapi3/client/3_0_3_unit_test/python
3+
inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml
4+
templateDir: modules/openapi-json-schema-generator/src/main/resources/python
5+
additionalProperties:
6+
packageName: unit_test_api
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
generatorName: python
2+
outputDir: samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python
3+
inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/nonCompliantUseDiscriminatorIfCompositionFails.yaml
4+
additionalProperties:
5+
packageName: this_package
6+
nonCompliantUseDiscriminatorIfCompositionFails: true

bin/configs/unmaintained/python_3_0_3_unit_test.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

bin/utils/export_docs_generators.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SCRIPT="$0"
44
echo "# START SCRIPT: ${SCRIPT}"
55

6-
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
6+
executable="./modules/openapi-json-schema-generator-cli/target/openapi-json-schema-generator-cli.jar"
77

88
if [[ "true" == "${SKIP_EXPORT_DOCS}" ]]; then
99
echo "Skipping doc exports. Note that docs generated by Windows may break paths as they have not yet been normalized to OS-specific paths."

bin/utils/export_generator.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ else
1212
exit 1;
1313
fi
1414

15-
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
15+
executable="./modules/openapi-json-schema-generator-cli/target/openapi-json-schema-generator-cli.jar"
16+
1617

1718
java -jar ${executable} config-help -g "${NAME}" --full-details --named-header --format markdown --markdown-header -o "docs/generators/${NAME}.md"

docs/generators/android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3434
|library|library template (sub-template) to use|<dl><dt>**volley**</dt><dd>HTTP client: Volley 1.0.19 (default)</dd><dt>**httpclient**</dt><dd>HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be deprecated in the next major release.</dd></dl>|null|
3535
|modelPackage|package for generated models| |null|
3636
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
37-
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
37+
|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|sourceFolder|source folder for generated code| |null|

docs/generators/aspnetcore.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3333
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false|
3434
|operationIsAsync|Set methods to async or sync (default).| |false|
3535
|operationModifier|Operation Modifier can be virtual or abstract|<dl><dt>**virtual**</dt><dd>Keep method virtual</dd><dt>**abstract**</dt><dd>Make method abstract</dd></dl>|virtual|
36-
|operationResultTask|Set methods result to Task&lt;&gt;.| |false|
36+
|operationResultTask|Set methods result to Task<>.| |false|
3737
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
3838
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
3939
|packageDescription|Specifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |A library generated from a OpenAPI doc|
@@ -42,11 +42,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4242
|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library|
4343
|packageVersion|C# package version.| |1.0.0|
4444
|pocoModels|Build POCO Models| |false|
45-
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
45+
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
4646
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4747
|sourceFolder|source folder for generated code| |src|
4848
|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|<dl><dt>**3.0.0**</dt><dd>Swashbuckle 3.0.0</dd><dt>**4.0.0**</dt><dd>Swashbuckle 4.0.0</dd><dt>**5.0.0**</dt><dd>Swashbuckle 5.0.0</dd><dt>**6.4.0**</dt><dd>Swashbuckle 6.4.0</dd></dl>|3.0.0|
49-
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
49+
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
5050
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
5151
|useDefaultRouting|Use default routing for the ASP.NET Core version.| |true|
5252
|useFrameworkReference|Use frameworkReference for ASP.NET Core 3.0+ and PackageReference ASP.NET Core 2.2 or earlier.| |false|

docs/generators/clojure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2525
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
2626
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
2727
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
28-
|projectDescription|description of the project (Default: using info.description or &quot;Client library of &lt;projectName&gt;&quot;)| |null|
28+
|projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null|
2929
|projectLicenseName|name of the license the project uses (Default: using info.license.name or not included in project.clj)| |null|
3030
|projectLicenseUrl|URL of the license the project uses (Default: using info.license.url or not included in project.clj)| |null|
31-
|projectName|name of the project (Default: generated from info.title or &quot;openapi-clj-client&quot;)| |null|
31+
|projectName|name of the project (Default: generated from info.title or "openapi-clj-client")| |null|
3232
|projectUrl|URL of the project (Default: using info.contact.url or not included in project.clj)| |null|
33-
|projectVersion|version of the project (Default: using info.version or &quot;1.0.0&quot;)| |null|
33+
|projectVersion|version of the project (Default: using info.version or "1.0.0")| |null|
3434
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3535
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
3636

docs/generators/cpp-pistache-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2222
|helpersPackage|Specify the package name to be used for the helpers (e.g. org.openapitools.server.helpers).| |org.openapitools.server.helpers|
2323
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
2424
|useStructModel|Use struct-based model template instead of get/set-based model template| |false|
25-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
25+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
2626

2727
## IMPORT MAPPING
2828

0 commit comments

Comments
 (0)