We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When updating a specs from OpenAPI 3.0 to OpenAPI 3.1, types cannot be shared anymore, as two unrelated types are generated.
7.11.0
Given these files:
foo.yaml
openapi: 3.0.4 info: title: foo API version: 0.0.1 paths: /foo: get: responses: 200: description: foo content: application/json: schema: $ref: 'user.yml#/Response'
bar.yaml
openapi: 3.0.4 info: title: bar API version: 0.0.1 paths: /bar: get: responses: 200: description: bar content: application/json: schema: $ref: 'user.yml#/Response'
and the shared common.yaml
common.yaml
Response: properties: id: type: integer
Running this will generate two files, one being the shared class:
for f in foo.yaml bar.yaml; do openapi-generator generate -g java -i $f; done tree src/main/java/org/openapitools/client/model src/main/java/org/openapitools/client/model ├── AbstractOpenApiSchema.java └── Response.java
But if you change these files to openapi: 3.1.0, each API will have its own class:
openapi: 3.1.0
src/main/java/org/openapitools/client/model ├── AbstractOpenApiSchema.java ├── BarGet200Response.java └── FooGet200Response.java
This will make re-using code very hard. What is the recommended way to share types (classes) between APIs?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report Checklist
Description
When updating a specs from OpenAPI 3.0 to OpenAPI 3.1, types cannot be shared anymore, as two unrelated types are generated.
openapi-generator version
7.11.0
Steps to reproduce
Given these files:
foo.yaml
bar.yaml
and the shared
common.yaml
Running this will generate two files, one being the shared class:
But if you change these files to
openapi: 3.1.0
, each API will have its own class:This will make re-using code very hard. What is the recommended way to share types (classes) between APIs?
The text was updated successfully, but these errors were encountered: