Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20

| OpenAPI JSON Schema Generator Version | OpenAPI Spec compatibility |
|---------------------------------------|----------------------------------------------|
| 3.3.0 | 3.0.0 - [3.1.0*](#openapi-v310-support) |
| 3.3.0+ | 3.0.0 - [3.1.0*](#openapi-v310-support) |
| 3.1.0 - 3.2.1 | 3.0.0 - [3.1.0](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/blob/3.1.0/docs/generators/python.md#schema-feature) |
| 1.0.0 - 3.0.0 | 3.0.0 - 3.0.3 |

Expand Down
6 changes: 3 additions & 3 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: Documentation for the java generator
| generator language | Java | |
| generator language version | 17 | |
| generator default templating engine | handlebars | |
| helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | |
| helpTxt | Generates a Java client library<br /><br />Features in this generator:<br />- v3.0.0 - [v3.0.3](#schema-feature) OpenAPI Specification support for component schemas<br />- Very [thorough documentation generated in the style of javadocs, includes code samples](samples/client/petstore/java/docs/components/schemas/Money.md#money)<br />- Input types constrained for a Schema in SomeSchema.validate<br /> - validate method can accept arbitrary List/Map/null/int/long/double/float/String json data<br />- Immutable List output classes generated and returned by validate for List&lt;?&gt; input<br />- Immutable Map output classes generated and returned by validate for Map&lt;?, ?&gt; input<br />- Strictly typed list input can be instantiated in client code using generated ListBuilders<br />- Strictly typed map input can be instantiated in client code using generated MapBuilders<br /> - Sequential map builders are generated ensuring that required properties are set before build is invoked. Looks like:<br /> - `new MapBuilder().requiredA("a").requiredB("b").build()`<br /> - `new MapBuilder().requiredA("a").requiredB("b").optionalProp("c").additionalProperty("someAddProp", "d").build()`<br />- Run time type checking and validation when<br /> - validating schema payloads<br /> - instantiating List output class (validation run)<br /> - instantiating Map output class (validation run)<br /> - Note: if needed, validation of json schema keywords can be deactivated via a SchemaConfiguration class<br />- Enums classes are generated and may be input into Schema.validate or the List/MapBuilder add/setter methods<br />- The [Checker-Framework's](https://github.com/typetools/checker-framework) NullnessChecker and @Nullable annotations are used in the java client<br /> - ensuring that null pointer exceptions will not happen<br />- Invalid (in java) property names supported like `class`, `1var`, `hi-there` etc in<br /> - component schema names<br /> - schema property names (a fallback setter is written in the MapBuilder)<br />- Generated interfaces are largely consistent with the python code<br />- Openapi spec inline schemas supported at any depth in any location<br />- Format support for: int32, int64, float, double, date, datetime, uuid<br />- Payload values are not coerced when validated, so a datetime value can pass other validations that describe the payload only as type string<br />- types are generated for enums of type string/integer/boolean using typing.Literal<br />- String transmission of numbers supported with type: string, format: number | |

## CONFIG OPTIONS
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.
Expand Down Expand Up @@ -48,8 +48,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl

| Extension name | Description | Applicable for | Default value |
| -------------- | ----------- | -------------- | ------------- |
|x-enum-varnames|A list of strings that defines the enum variable names, must be adjacent to enums|SCHEMA|[]
|x-enum-descriptions|A list of strings that defines the enum descriptions, must be adjacent to enums|SCHEMA|[]
|x-enum-varnames|A list of strings that defines the enum variable names, must be adjacent to enum|SCHEMA|[]
|x-enum-descriptions|A list of strings that defines the enum descriptions, must be adjacent to enum|SCHEMA|[]


## INSTANTIATION TYPES
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl

| Extension name | Description | Applicable for | Default value |
| -------------- | ----------- | -------------- | ------------- |
|x-enum-varnames|A list of strings that defines the enum variable names, must be adjacent to enums|SCHEMA|[]
|x-enum-descriptions|A list of strings that defines the enum descriptions, must be adjacent to enums|SCHEMA|[]
|x-enum-varnames|A list of strings that defines the enum variable names, must be adjacent to enum|SCHEMA|[]
|x-enum-descriptions|A list of strings that defines the enum descriptions, must be adjacent to enum|SCHEMA|[]


## INSTANTIATION TYPES
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
</dependencies>
<properties>
<!-- RELEASE_VERSION -->
<revision>4.0.0-alpha</revision>
<revision>4.0.0</revision>
<!-- /RELEASE_VERSION -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,39 @@ public String getName() {

@Override
public String getHelp() {
return "Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more.";
return String.join("<br />",
"Generates a Java client library",
"",
"Features in this generator:",
"- v3.0.0 - [v3.0.3](#schema-feature) OpenAPI Specification support for component schemas",
"- Very [thorough documentation generated in the style of javadocs, includes code samples](samples/client/petstore/java/docs/components/schemas/Money.md#money)",
"- Input types constrained for a Schema in SomeSchema.validate",
" - validate method can accept arbitrary List/Map/null/int/long/double/float/String json data",
"- Immutable List output classes generated and returned by validate for List&lt;?&gt; input",
"- Immutable Map output classes generated and returned by validate for Map&lt;?, ?&gt; input",
"- Strictly typed list input can be instantiated in client code using generated ListBuilders",
"- Strictly typed map input can be instantiated in client code using generated MapBuilders",
" - Sequential map builders are generated ensuring that required properties are set before build is invoked. Looks like:",
" - `new MapBuilder().requiredA(\"a\").requiredB(\"b\").build()`",
" - `new MapBuilder().requiredA(\"a\").requiredB(\"b\").optionalProp(\"c\").additionalProperty(\"someAddProp\", \"d\").build()`",
"- Run time type checking and validation when",
" - validating schema payloads",
" - instantiating List output class (validation run)",
" - instantiating Map output class (validation run)",
" - Note: if needed, validation of json schema keywords can be deactivated via a SchemaConfiguration class",
"- Enums classes are generated and may be input into Schema.validate or the List/MapBuilder add/setter methods",
"- The [Checker-Framework's](https://github.com/typetools/checker-framework) NullnessChecker and @Nullable annotations are used in the java client",
" - ensuring that null pointer exceptions will not happen",
"- Invalid (in java) property names supported like `class`, `1var`, `hi-there` etc in",
" - component schema names",
" - schema property names (a fallback setter is written in the MapBuilder)",
"- Generated interfaces are largely consistent with the python code",
"- Openapi spec inline schemas supported at any depth in any location",
"- Format support for: int32, int64, float, double, date, datetime, uuid",
"- Payload values are not coerced when validated, so a datetime value can pass other validations that describe the payload only as type string",
"- types are generated for enums of type string/integer/boolean using typing.Literal",
"- String transmission of numbers supported with type: string, format: number"
);
}

public String packagePath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public enum VendorExtension {

X_ENUM_VARNAMES("x-enum-varnames", ExtensionLevel.SCHEMA, "A list of strings that defines the enum variable names, must be adjacent to enums", "[]"),
X_ENUM_DESCRIPTIONS("x-enum-descriptions", ExtensionLevel.SCHEMA, "A list of strings that defines the enum descriptions, must be adjacent to enums", "[]"),
X_ENUM_VARNAMES("x-enum-varnames", ExtensionLevel.SCHEMA, "A list of strings that defines the enum variable names, must be adjacent to enum", "[]"),
X_ENUM_DESCRIPTIONS("x-enum-descriptions", ExtensionLevel.SCHEMA, "A list of strings that defines the enum descriptions, must be adjacent to enum", "[]"),
;

private final String name;
Expand Down