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

Commit 7eb4fca

Browse files
authored
v4.0.0 release (#354)
* v400 release * Docs updated * Java docs updated
1 parent 5428fa3 commit 7eb4fca

File tree

6 files changed

+42
-10
lines changed

6 files changed

+42
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
139139

140140
| OpenAPI JSON Schema Generator Version | OpenAPI Spec compatibility |
141141
|---------------------------------------|----------------------------------------------|
142-
| 3.3.0 | 3.0.0 - [3.1.0*](#openapi-v310-support) |
142+
| 3.3.0+ | 3.0.0 - [3.1.0*](#openapi-v310-support) |
143143
| 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) |
144144
| 1.0.0 - 3.0.0 | 3.0.0 - 3.0.3 |
145145

docs/generators/java.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ title: Documentation for the java generator
1212
| generator language | Java | |
1313
| generator language version | 17 | |
1414
| generator default templating engine | handlebars | |
15-
| helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | |
15+
| 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 | |
1616

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

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

5454

5555
## INSTANTIATION TYPES

docs/generators/python.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3434

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

4040

4141
## INSTANTIATION TYPES

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
</dependencies>
447447
<properties>
448448
<!-- RELEASE_VERSION -->
449-
<revision>4.0.0-alpha</revision>
449+
<revision>4.0.0</revision>
450450
<!-- /RELEASE_VERSION -->
451451
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
452452
<java.version>11</java.version>

src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java

+33-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,39 @@ public String getName() {
308308

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

314346
public String packagePath() {

src/main/java/org/openapijsonschematools/codegen/generators/models/VendorExtension.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
public enum VendorExtension {
77

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

1212
private final String name;

0 commit comments

Comments
 (0)