"other" value and models it as a separate union branch that requires a freeform description. This preserves the analytical benefits of a closed enum for known categories while capturing novel ones accurately.
Use case
Issue triage where most tickets fit known categories (billing, technical, account, shipping), but some do not, and you need to capture what they actually are instead of forcing a bad fit.
Schema pattern
Example outputs
Known category:Why this works
For the vast majority of inputs,issue_type is one of the four known values. Your analytics dashboards, routing rules, and reports all work unchanged. When a genuinely novel category appears, the model selects "other" and the second oneOf branch requires other_issue_type, a bounded freeform string that captures what the issue actually is.
This gives you the best of both worlds: a closed enum for known categories (fast aggregation, reliable routing) and a structured escape hatch for new ones (no data loss, easy to review). Over time, you can promote frequently-seen other_issue_type values into the main enum.