Skip to content

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

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions