Skip to content

Commit ce4a6a3

Browse files
authored
add oneOf lookup option in python client generator (#16154)
1 parent 76989db commit ce4a6a3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

docs/generators/python.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3131
|packageVersion|python package version.| |1.0.0|
3232
|projectName|python project name in setup.py (e.g. petstore-api).| |null|
3333
|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null|
34+
|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|
3435

3536
## IMPORT MAPPING
3637

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public PythonClientCodegen() {
180180
.defaultValue("%Y-%m-%dT%H:%M:%S%z"));
181181
cliOptions.add(new CliOption(DATE_FORMAT, "date format for query parameters")
182182
.defaultValue("%Y-%m-%d"));
183+
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
183184

184185
supportedLibraries.put("urllib3", "urllib3-based client");
185186
supportedLibraries.put("asyncio", "asyncio-based client");

0 commit comments

Comments
 (0)