-
Notifications
You must be signed in to change notification settings - Fork 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
allOf needs $ref
first
#2924
Comments
same issue here, did you solve? |
As a workaround, you can convert the inline object to reference model or put the reference model first. |
Hi, Model: {
"type": "object",
"properties": {
"relatedX": {
"type": "string",
"description": "some testing description"
},
"airplaneSpec": {
"type":"object",
"allOf": [
{
"$ref": "./BasicDefinition.json#/properties/baseComponentType"
},
{
"type": "object",
"properties": {
"EngineModelCode": {
"type": "string",
"description": "Engine Model - factory code"
}
}
}
]
}
}
} Code: @JsonProperty("airplaneSpec")
private Object airplaneSpec = null; However, if instead of the inline definition of the "allOf" a $ref is used, it generates the code correctly. Model:
Code:
And the Test1 java file is being generated. Command line used for generation: I could find two other related issues being raised #3225 and #6148. |
Description
When generating a library with an
allOf
construct in a model definition, the codegen seems to have problems if the first array item is an inline object vs. a model referenceSwagger-codegen version
2.1.6
Command line used for generation
Occurs on java with this trace:
The text was updated successfully, but these errors were encountered: