Skip to content

Commit 866df36

Browse files
authored
[python-exp] simplify examples (#7157)
* Adds example setting code in python-experimental with one fn setting example values Fixes sample indentations Handles composed schema models, object model and arraymodels Adds brackets in arraymodel input Sets modelName with map schemas Removes included_schemas arguments, dicriminator examples do not include property examples Refactors modelName into toExampleValueRecursive argument Fixes bug where example models contained themselves Stops using model ExampleGenerator examples because they are inconsistent with the ones in python-experimental Uses example values if they exist Removes single quotes from enum examples Fixes password example Adds commented our regex handling, commented out because it breaks Handles AnyType schema examples Adds x_example values for simple string properties, uses toExampleValue for all example generation Adds examples for simple string parameters Updates comments in toExampleValueBase Fixes the double nested bug for AdditionalPropertiesWithArrayOfEnums Fixes bug where NumberWithValidations had double nesting Updates simple string examples in arrays Fixes array string examples Fixes example for string endpoint body example Adds exampleFromStringOrArraySchema Adds regex examples, pegs slf4j-version to v1.7.29 for rgxgen Adds comment about regex seed Updates pattern matcher to not handle ^ and $ Updates used sample values Adds ensureQuotes Adds ensureQuotes Fixes double quote bug Updates mustache file Adds ensureQuotes to key handling Adds modelNameToSchema map, reduces run time by using it Fixes java tests Regenerates python-experimental samples Fixes python test * Rebased on master * Adds getModelNameToSchemaCache * Updates toDefaultValue to not mutate schemas * Has all dates and datetimes default and example setting use the same helper function * Samples regenerated * indentation tweak, removes txt from sample file
1 parent c19350b commit 866df36

File tree

65 files changed

+1495
-436
lines changed

Some content is hidden

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

65 files changed

+1495
-436
lines changed

modules/openapi-generator-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</profiles>
7373

7474
<properties>
75-
<slf4j-version>1.7.12</slf4j-version>
75+
<slf4j-version>1.7.29</slf4j-version>
7676
<guava-version>26.0-jre</guava-version>
7777
</properties>
7878
</project>

modules/openapi-generator/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
<diffutils-version>1.3.0</diffutils-version>
259259
<guava-version>26.0-jre</guava-version>
260260
<generex-version>1.0.2</generex-version>
261+
<rxgen-version>1.1</rxgen-version>
261262
<jackson-version>2.10.1</jackson-version>
262263
<jackson-threetenbp-version>2.10.0</jackson-threetenbp-version>
263264
<kotlin-version>1.3.60</kotlin-version>
@@ -373,6 +374,11 @@
373374
<artifactId>generex</artifactId>
374375
<version>${generex-version}</version>
375376
</dependency>
377+
<dependency>
378+
<groupId>com.github.curious-odd-man</groupId>
379+
<artifactId>rgxgen</artifactId>
380+
<version>${rxgen-version}</version>
381+
</dependency>
376382
<dependency>
377383
<groupId>com.fasterxml.jackson.datatype</groupId>
378384
<artifactId>jackson-datatype-jsr310</artifactId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6191,7 +6191,7 @@ public List<CodegenServerVariable> fromServerVariables(Map<String, ServerVariabl
61916191
return codegenServerVariables;
61926192
}
61936193

6194-
private void setParameterNullable(CodegenParameter parameter, CodegenProperty property) {
6194+
protected void setParameterNullable(CodegenParameter parameter, CodegenProperty property) {
61956195
if (parameter == null || property == null) {
61966196
return;
61976197
}

0 commit comments

Comments
 (0)