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

+1
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"
+6
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
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

-6
This file was deleted.

bin/utils/export_docs_generators.sh

+1-1
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

+2-1
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

+1-1
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

+3-3
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

+3-3
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

+1-1
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

docs/generators/cpp-qt-client.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3131
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
3232
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3333
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
34-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
34+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3535

3636
## IMPORT MAPPING
3737

docs/generators/cpp-qt-qhttpengine-server.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3030
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
3131
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3232
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
33-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
33+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3434

3535
## IMPORT MAPPING
3636

docs/generators/cpp-restbed-server-deprecated.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2020
| ------ | ----------- | ------ | ------- |
2121
|apiPackage|C++ namespace for apis (convention: name.space.api).| |org.openapitools.server.api|
2222
|declspec|C++ preprocessor to place before the class name for handling dllexport/dllimport.| ||
23-
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include &quot;Commons.h&quot; | ||
23+
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | ||
2424
|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.server.model|
2525
|packageVersion|C++ package version.| |1.0.0|
2626
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|

docs/generators/cpp-restbed-server.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2020
| ------ | ----------- | ------ | ------- |
2121
|apiPackage|C++ namespace for apis (convention: name.space.api).| |org.openapitools.server.api|
2222
|declspec|C++ preprocessor to place before the class name for handling dllexport/dllimport.| ||
23-
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include &quot;Commons.h&quot; | ||
23+
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | ||
2424
|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.server.model|
2525
|packageVersion|C++ package version.| |1.0.0|
2626
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|

docs/generators/cpp-restsdk.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2020
| ------ | ----------- | ------ | ------- |
2121
|apiPackage|C++ namespace for apis (convention: name.space.api).| |org.openapitools.client.api|
2222
|declspec|C++ preprocessor to place before the class name for handling dllexport/dllimport.| ||
23-
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include &quot;Commons.h&quot; | ||
23+
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | ||
2424
|generateGMocksForApis|Generate Google Mock classes for APIs.| |null|
2525
|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.client.model|
2626
|packageName|C++ package (library) name.| |CppRestOpenAPIClient|
2727
|packageVersion|C++ package version.| |1.0.0|
2828
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
29-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
29+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3030

3131
## IMPORT MAPPING
3232

docs/generators/cpp-tiny.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2828
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
2929
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3030
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
31-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
31+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3232

3333
## IMPORT MAPPING
3434

docs/generators/cpp-tizen.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2727
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
2828
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
2929
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
30-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
30+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3131

3232
## IMPORT MAPPING
3333

docs/generators/cpp-ue4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3030
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3131
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
3232
|unrealModuleName|Name of the generated unreal module (optional)| |OpenAPI|
33-
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
33+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
3434

3535
## IMPORT MAPPING
3636

docs/generators/csharp-netcore-functions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3232
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false|
3333
|operationIsAsync|Set methods to async or sync (default).| |false|
3434
|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|
35-
|operationResultTask|Set methods result to Task&lt;&gt;.| |false|
35+
|operationResultTask|Set methods result to Task<>.| |false|
3636
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
3737
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
3838
|packageDescription|Specifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |A library generated from a OpenAPI doc|
3939
|packageGuid|The GUID that will be associated with the C# project| |null|
4040
|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools|
4141
|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library|
4242
|packageVersion|C# package version.| |1.0.0|
43-
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
43+
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
4444
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4545
|sourceFolder|source folder for generated code| |src|
46-
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
46+
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
4747
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
4848
|useNewtonsoft|Uses the Newtonsoft JSON library.| |true|
4949

docs/generators/csharp-netcore.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4040
|packageTags|Tags to identify the package| |null|
4141
|packageVersion|C# package version.| |1.0.0|
4242
|releaseNote|Release note, default to 'Minor update'.| |Minor update|
43-
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
43+
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
4444
|sourceFolder|source folder for generated code| |src|
4545
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd><dt>**net5.0**</dt><dd>.NET 5.0 compatible</dd><dt>**net6.0**</dt><dd>.NET 6.0 compatible</dd></dl>|netstandard2.0|
46-
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
46+
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
4747
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
4848
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
4949
|validatable|Generates self-validatable models.| |true|

0 commit comments

Comments
 (0)