JSON Schema oneOf Keyword

The value must match exactly one of the listed schemas.

Syntax

{"oneOf": [{"type": "string"}, {"type": "number"}]}

Explanation

Use oneOf for discriminated unions and mutually exclusive shapes.