Azure / autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
MIT License
4.59k stars 731 forks source link

Linter Rule RequiredPropertiesMustExist does not account for AllOf #1383

Closed John-Hart closed 8 years ago

John-Hart commented 8 years ago

WARNING: RequiredPropertiesMustExist: Required property 'name' does not appear in the list of properties Location: Path: #->Definitions->CheckAvailabilityParameters->Required->[0]

"definitions": {
    "CheckAvailabilityParameters": {
      "properties": {
        "isAvailiable": {
          "type": "boolean",
          "description": "True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false."
        }
      },
      "required": [
        "**name**"
      ],
      "**allOf**": [
        {
          "$ref": "#/definitions/Resource"
        }
      ],
      "description": "Parameters supplied to the Check Name Availability for Namespace and NotificationHubs."
    },
  "Resource": {
      "properties": {
        "id": {
          "readOnly": true,
          "type": "string",
          "description": "Resource Id"
        },
        "**name**": {
          "readOnly": true,
          "type": "string",
          "description": "Resource name"
        },
        "type": {
          "readOnly": true,
          "type": "string",
          "description": "Resource type"
        },
        "location": {
          "type": "string",
          "description": "Resource location"
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Resource tags"
        }
      },
      "required": [
        "location"
      ],
      "x-ms-azure-resource": true
    },
  }
}
tbombach commented 8 years ago

Fixed