Skip to content

Question, Specification Ambiguity: Using of "allOf: []"  #619

@ivanignatiev

Description

@ivanignatiev

Which of model difinitions respects the specification 2.0 ?

First:

"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"
}

or second? :

"ApplicationGatewayIPConfiguration": {
    "allOf": [{
        "$ref": "#/definitions/SubResource"
    },
    {
        "type": "object",
                "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"
            }
        }
    }],
    "description": "IP configuration of application gateway"
}

The question is appeared because Swagger CodeGen ignore the first definition, but Azure Rest API uses it ( https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2016-03-30/swagger/network.json ). In the specification we can find examples and descriptions related only to the second case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions