Restrict a value to a known set of strings.
Section: Schema basics
Enum restriction
json
json
{
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": ["draft", "published", "archived"]
}
},
"required": ["status"]
}Explanation
Enums are useful for states, roles, and constrained option lists.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Schema basics