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
"ApplicationGatewayIPConfiguration": {"properties": {"properties": {"x-ms-client-flatten": true,"$ref": "#/definitions/ApplicationGatewayIPConfigurationPropertiesFormat"},"name": {"type": "string","description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"},"etag": {"type": "string","description": "A unique read-only string that changes whenever the resource is updated"}},"allOf": [{"$ref": "#/definitions/SubResource"}],"description": "IP configuration of application gateway"}
Swagger CodeGen will generate following incorrect code for Java :
"ApplicationGatewayIPConfiguration": {"allOf": [{"$ref": "#/definitions/SubResource"},{"type": "object","properties": {"properties": {"$ref": "#/definitions/ApplicationGatewayIPConfigurationPropertiesFormat"},"name": {"type": "string","description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"},"etag": {"type": "string","description": "A unique read-only string that changes whenever the resource is updated"}}}],"description": "IP configuration of application gateway"}
We will get the expected result :
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-01T18:40:11.781+02:00")
publicclassApplicationGatewayIPConfigurationextendsSubResource {
privateStringname = null;
privateStringetag = null;
privateStringid = null;
privateApplicationGatewayIPConfigurationPropertiesFormatproperties = null;
/** * Gets name of the resource that is unique within a resource group. This name can be used to access the resource **/@ApiModelProperty(value = "Gets name of the resource that is unique within a resource group. This name can be used to access the resource")
@JsonProperty("name")
publicStringgetName() {
returnname;
}
publicvoidsetName(Stringname) {
this.name = name;
}
I have opened an issue in OpenAPI-Specification repository as well to get more information #OAI/OpenAPI-Specification#619
The text was updated successfully, but these errors were encountered:
ivanignatiev
changed the title
Question, Specification Ambiguity: Using of "allOf: []"
Model definitions with allOf
Apr 4, 2016
It's seems that model compositions in Swagger CodeGen doe not work well.
For example, we can take a model from https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2016-03-30/swagger/network.json :
Swagger CodeGen will generate following incorrect code for Java :
And if we will use model definition below :
We will get the expected result :
I have opened an issue in OpenAPI-Specification repository as well to get more information #OAI/OpenAPI-Specification#619
The text was updated successfully, but these errors were encountered: