-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
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
[Java] Generate model for component with allOf has not attributes #1602
Comments
@wing328 which snapshot version i should use for testing |
@ravthiru you will need to build the JAR from the branch locally as the PR has not yet been merged into master. |
No the said branch has not fixed the issue, for below spec Pet model class should have id, name and tag attributes, but with generated Pet Model class only extends Address
|
I used the branch oas3-spec-support1 |
@ravthiru: I did not look in detail at the change made in the PR, but I think that the correct way of expressing what you want is: components:
schemas:
Pet:
allOf:
- $ref: "#/components/schemas/address"
- type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
address:
type: object
properties:
location:
type: string
city:
type: string => Please notice the indentation difference. And as far as I know this is already working with version @wing328 : swagger-editor https://editor.swagger.io/ seems to support this as well: components:
schemas:
Pet:
allOf:
- $ref: "#/components/schemas/address"
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
address:
type: object
properties:
location:
type: string
city:
type: string I am not sure if this is correct or not from an OpenAPI Spec perspective or not and I also did not look at how the Swagger-Parser is parsing this. |
Thanks it was because of indentation issue , it is working now |
Description
openapi-generator version
3.3.4
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: