Skip to content

Why not support refs in union mapping? #10

Open
@AlexSugak

Description

@AlexSugak

Hi!

I get it (I think so) why members of the discriminated union's mapping must be of propertiesForm. But why can't it be a refForm pointing to a propertiesForm? E.g. something like this is not allowed, while I think it is fine to have such schema:

{
  "discriminator": "kind",
  "mapping": {
    "a": {
      "properties": {
        "foo": { "type": "string" }
      }
    },
    "b": {
      "ref": "b"
    }
  },
  "definitions": {
    "b": {
      "properties": {
        "baz": { "type": "string" }
      }
    }
  }
}

I understand that changing this would require a new RFC but I was just wondering about the reasoning behind such limitation.

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