Skip to content

Base Model properties are not resolved when extended #1723

@hassansin

Description

@hassansin

In the example spec, after extending Pet in Cat object, Pet properties are not resolved. Instead shows a file reference:

{
  "swagger":"2.0",
  "info":{    
  },
  "host":"localhost:9000",
  "schemes":[
    "http"
  ],
  "basePath":"/2.0",
  "paths":{
    "/":{
      "get":{
        "responses":{
          "200":{
            "description":"Pets",
            "schema":{
              "$ref":"#/definitions/Pet"
            }
          }
        },
        "parameters":[          

        ]
      }
    }
  },
  "definitions":{    
    "Cat":{
      "allOf": [
        {
          "$ref": "#/definitions/Pet"
        }, 
        {
          "type": "object",
          "properties":{
            "size":{
              "type": "number"
            }
          }
        }
      ]
    },
    "Pet":{  
      "type": "object",    
      "properties":{       
        "color":{
          "$ref":"#/definitions/Color"
        }
      }
    },
    "Color":{
      "type": "string"
    }
  }
}

image

It works if Cat is removed from definitions. Is something wrong with my definition? Thanks

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