1

Is there an elif/elseif/switch statement in JSON-Schema? I doesn't seem to be there.

1 Answers1

1

You can use "allOf" with a list of objects of if-statements

 "allOf": [
    {
      "if": {...},
      "else": {...}
    },
    {
      "if": {...},
      "else": {...}
    }
  ]

Be aware that this list needs to be on the level of the object to which items it refers!

source: https://json-schema.org/understanding-json-schema/reference/conditionals.html