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

Commit 18f7b38

Browse files
authored
Lists java generator, updates version to 4.0.0-alpha (#348)
* Lists java generator, updates version to 4.0.0-alpha * Readme updated * Adds javadoc bullet * Fixes bullet loc * Removes binary format
1 parent ad77012 commit 18f7b38

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ so developers can use all of those features.
1515

1616
Currently, the following languages/frameworks are supported:
1717

18-
- python
18+
- python (Stability: Stable)
19+
- java (Stability: Experimental)
20+
- So far schema validation for v3.0.0-v3.0.3 has been implemented for Java
21+
- If you want to use this generator as a Java client, please consider filing PRs adding openapi features in [this project](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues/290)
1922

2023
## Join Our Community
2124
We use a Discord server as a place to ask questions and help each other. It offers functionality very similar to Slack.
@@ -60,10 +63,49 @@ And many more!
6063
- [generated client sample code](samples/client/petstore/python)
6164
- [Openapi v3.0.3 general petstore spec, general features](src/test/resources/3_0/python/petstore_customized.yaml)
6265
- [generated v3.1.0 unit test client sample code](samples/client/3_1_0_unit_test/python)
63-
- [Openapi json schema v3.1.0 unit test spec](src/test/resources/3_1/unit_test_spec/3_1_0_unit_test_spec.yaml)
66+
- [Openapi json schema v3.1.0 unit test spec](src/test/resources/3_1/unit_test_spec/3_1_0_unit_test_spec.yaml)
6467
- [generated v3.0.3 unit test client sample code](samples/client/3_0_3_unit_test/python)
6568
- [Openapi json schema v3.0.3 unit test spec](src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml)
6669

70+
## Reasons To Use the Java Generator
71+
72+
- v3.0.0 - [v3.0.3](docs/generators/java.md#schema-feature) OpenAPI Specification support for component schemas
73+
- Very [thorough documentation generated in the style of javadocs, includes code samples](samples/client/petstore/java/docs/components/schemas/Money.md#money)
74+
- Input types constrained for a Schema in SomeSchema.validate
75+
- validate method can accept arbitrary List/Map/null/int/long/double/float/String json data
76+
- Immutable List output classes generated and returned by validate for List<?> input
77+
- Immutable Map output classes generated and returned by validate for Map<?,?> input
78+
- Strictly typed list input can be instantiated in client code using generated ListBuilders
79+
- Strictly typed map input can be instantiated in client code using generated MapBuilders
80+
- Sequential map builders are generated ensuring that required properties are set before build is invoked. Looks like:
81+
- `new MapBuilder().requiredA("a").requiredB("b").build()`
82+
- `new MapBuilder().requiredA("a").requiredB("b").optionalProp("c").additionalProperty("someAddProp", "d").build()`
83+
- Run time type checking and validation when
84+
- validating schema payloads
85+
- instantiating List output class (validation run)
86+
- instantiating Map output class (validation run)
87+
- Note: if needed, validation of json schema keywords can be deactivated via a SchemaConfiguration class
88+
- Enums classes are generated and may be input into Schema.validate or the List/MapBuilder add/setter methods
89+
- The [Checker-Framework's](https://github.com/typetools/checker-framework) NullnessChecker and @Nullable annotations are used in the java client
90+
- ensuring that null pointer exceptions will not happen
91+
- Invalid (in java) property names supported like `class`, `1var`, `hi-there` etc in
92+
- schema property names (a fallback setter is written in the MapBuilder)
93+
- Generated interfaces are largely consistent with the python code
94+
- Openapi spec inline schemas supported at any depth in any location
95+
- Format support for: int32, int64, float, double, date, datetime, uuid
96+
- Payload values are not coerced when validated, so a datetime value can pass other validations that describe the payload only as type string
97+
- types are generated for enums of type string/integer/boolean using typing.Literal
98+
- String transmission of numbers supported with type: string, format: number, value can be accessed as a Decimal with schemas.as_decimal(inst)
99+
- [Autogenerated thorough testing of json schema keyword features in models and endpoints](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas) which come from the [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite)
100+
- [Tests are passing in CI](https://app.circleci.com/pipelines/github/openapi-json-schema-tools/openapi-json-schema-generator?branch=master)
101+
102+
And many more!
103+
- [Docs for the java generator](docs/generators/java.md)
104+
- [generated client sample code](samples/client/petstore/java)
105+
- [Openapi v3.0.3 general petstore spec, general features](src/test/resources/3_0/python/petstore_customized.yaml)
106+
- [generated v3.0.3 unit test client sample code](samples/client/3_0_3_unit_test/java)
107+
- [Openapi json schema v3.0.3 unit test spec](src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec_nopaths.yaml)
108+
67109
### Can I build here?
68110

69111
Yes; contributions are welcome!

pom.xml

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

0 commit comments

Comments
 (0)