Skip to content

Error "incompatible properties" for properties compatible via $ref #331

@mikeharder

Description

@mikeharder

The two bar properties should be considered compatible, because the types are effectively identical (one just flows through an extra $ref):

"FooBarString": {
  "type":"object",
  "properties": {
    "bar": {
      "type":"string"
    }
  },
  "allOf": [
    {
      "$ref": "#/definitions/FooBarStringRef"
    }
  ]
},
"FooBarStringRef": {
  "type":"object",
  "properties": {
    "bar": {
      "$ref":"#/definitions/MyString"
    }
  }
},
"MyString": {
  "type": "string"
}

Instead they generate an error:

    incompatible properties : bar
      definitions/FooBarString/properties/bar
        at file:///mnt/vss/_work/1/s/src/test/specs/compatible-properties-ref.json#L13:8
      definitions/FooBarStringRef/properties/bar
        at file:///mnt/vss/_work/1/s/src/test/specs/compatible-properties-ref.json#L26:8

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🎊 Closed

Status

🎊 Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions