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

Commit e378f80

Browse files
authored
v3.1.0 release (#245)
* v310 release * Improves footnote * Adds preliminary spec support section * Removes footnote * Fixes anchors * Removes 310 warning
1 parent e50ffc7 commit e378f80

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

Diff for: README.md

+34-15
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
[![CI Tests](https://dl.circleci.com/status-badge/img/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master)
44
[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE)
55

6-
Auto generate a client sdk from your openapi 3.0.0-3.0.3 document using Openapi JSON Schema Generator.
6+
Auto generate a client sdk from your openapi 3.0.0-3.1.0 document using Openapi JSON Schema Generator.
77
This project is a code generator that focuses on supporting all openapi and json schema features.
88

99
## Overview
1010
OpenAPI JSON Schema Generator allows auto-generation of API client libraries (SDK generation) given an
11-
[OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (3.0.0-3.0.3 are supported).
11+
[OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (3.0.0-[3.1.0*](#preliminary-310-spec-support) are supported).
1212
This project focuses on making the output 100% compliant with openapi + JSON schema specs.
1313
The goal is to fully support everything defined in openapi + the included JSON schema specs
1414
so developers can use all of those features.
@@ -23,6 +23,7 @@ You can join us here: https://discord.gg/mHB8WEQuYQ
2323

2424
## Reasons To Use the Python Generator
2525

26+
- [3.1.0*](#preliminary-310-spec-support) - 3.0.0 spec support
2627
- Type hints on
2728
- schema payload inputs in SomeSchema.validate ![validate screen capture](docs/schema_validate.gif)
2829
- Note: to make input dictionaries TypedDicts like the Money.validate example, set additionalProperties to false in the schema in your openapi document
@@ -58,8 +59,10 @@ And many more!
5859
- [Docs for the python generator](docs/generators/python.md)
5960
- [generated client sample code](samples/client/petstore/python)
6061
- [Openapi v3.0.3 general petstore spec, general features](src/test/resources/3_0/python/petstore_customized.yaml)
61-
- [generated client sample code](samples/client/3_0_3_unit_test/python)
62+
- [generated v3.0.3 unit test client sample code](samples/client/3_0_3_unit_test/python)
6263
- [Openapi json schema v3.0.3 unit test spec](src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml)
64+
- [generated v3.1.0 unit test client sample code](samples/client/3_1_0_unit_test/python)
65+
- [Openapi json schema v3.1.0 unit test spec](src/test/resources/3_1/unit_test_spec/3_1_0_unit_test_spec.yaml)
6366

6467
### Can I build here?
6568

@@ -91,18 +94,34 @@ Submit a PR if you want to add a new server scaffold, client sdk, or documentati
9194

9295
The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The openapi-json-schema-generator project has the following compatibilities with the OpenAPI Specification:
9396

94-
| OpenAPI JSON Schema Generator Version | OpenAPI Spec compatibility |
95-
|---------------------------------------|-----------------------------|
96-
| 3.0.0 | 3.0.0 - 3.0.3 |
97-
| 2.0.3 | 3.0.0 - 3.0.3 |
98-
| 2.0.2 | 3.0.0 - 3.0.3 |
99-
| 2.0.1 | 3.0.0 - 3.0.3 |
100-
| 2.0.0 | 3.0.0 - 3.0.3 |
101-
| 1.0.4 | 3.0.0 - 3.0.3 |
102-
| 1.0.3 | 3.0.0 - 3.0.3 |
103-
| 1.0.2 | 3.0.0 - 3.0.3 |
104-
| 1.0.1 | 3.0.0 - 3.0.3 |
105-
| 1.0.0 | 3.0.0 - 3.0.3 |
97+
| OpenAPI JSON Schema Generator Version | OpenAPI Spec compatibility |
98+
|---------------------------------------|--------------------------------------------------|
99+
| 3.1.0 | 3.0.0 - [3.1.0*](#preliminary-310-spec-support) |
100+
| 3.0.0 | 3.0.0 - 3.0.3 |
101+
| 2.0.3 | 3.0.0 - 3.0.3 |
102+
| 2.0.2 | 3.0.0 - 3.0.3 |
103+
| 2.0.1 | 3.0.0 - 3.0.3 |
104+
| 2.0.0 | 3.0.0 - 3.0.3 |
105+
| 1.0.4 | 3.0.0 - 3.0.3 |
106+
| 1.0.3 | 3.0.0 - 3.0.3 |
107+
| 1.0.2 | 3.0.0 - 3.0.3 |
108+
| 1.0.1 | 3.0.0 - 3.0.3 |
109+
| 1.0.0 | 3.0.0 - 3.0.3 |
110+
111+
#### Preliminary 3.1.0 spec support
112+
Preliminary 3.1.0 spec support includes these json schema keywords:
113+
1. type (array of types supported in addition to one non-array value)
114+
2. const: only string values are working because of bugs in swagger parser
115+
3. contains
116+
4. dependentRequired
117+
5. dependentSchemas
118+
6. maxContains
119+
7. minContains
120+
8. patternProperties
121+
9. prefixItems
122+
10. propertyNames
123+
11. unevaluatedItems
124+
12. unevaluatedProperties
106125

107126

108127
### Build Projects

Diff for: pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
</dependencies>
437437
<properties>
438438
<!-- RELEASE_VERSION -->
439-
<revision>3.0.0</revision>
439+
<revision>3.1.0</revision>
440440
<!-- /RELEASE_VERSION -->
441441
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
442442
<java.version>11</java.version>

Diff for: src/main/java/org/openapijsonschematools/codegen/common/CodegenConstants.java

-4
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,6 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
405405
public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC =
406406
"If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " +
407407
"If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.";
408-
public static final String UNSUPPORTED_V310_SPEC_MSG =
409-
"Generation using 3.1.0 specs is in development and is not officially supported yet. " +
410-
"If you would like to expedite development, please consider woking on the open issues in the 3.1.0 project: https://github.com/orgs/openapi-json-schema-tools/projects/4 " +
411-
"and reach out to our team on Discord at https://discord.gg/mHB8WEQuYQ";
412408
public static final String ENUM_UNKNOWN_DEFAULT_CASE = "enumUnknownDefaultCase";
413409
public static final String ENUM_UNKNOWN_DEFAULT_CASE_DESC =
414410
"If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response." +

Diff for: src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java

-3
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,6 @@ public void setOpenAPI(OpenAPI openAPI) {
608608
int specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1));
609609
int specMinorVersion = Integer.parseInt(originalSpecVersion.substring(2, 3));
610610
boolean specVersionGreaterThanOrEqualTo310 = (specMajorVersion == 3 && specMinorVersion >= 1);
611-
if (specVersionGreaterThanOrEqualTo310) {
612-
LOGGER.warn(CodegenConstants.UNSUPPORTED_V310_SPEC_MSG);
613-
}
614611
this.openAPI = openAPI;
615612
// Set global settings such that helper functions in ModelUtils can look up the value
616613
// of the CLI option.

0 commit comments

Comments
 (0)