You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,10 @@ so developers can use all of those features.
15
15
16
16
Currently, the following languages/frameworks are supported:
17
17
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)
19
22
20
23
## Join Our Community
21
24
We use a Discord server as a place to ask questions and help each other. It offers functionality very similar to Slack.
-[Openapi v3.0.3 general petstore spec, general features](src/test/resources/3_0/python/petstore_customized.yaml)
62
65
-[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)
64
67
-[generated v3.0.3 unit test client sample code](samples/client/3_0_3_unit_test/python)
65
68
-[Openapi json schema v3.0.3 unit test spec](src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml)
66
69
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:
- 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)
0 commit comments