Skip to main content
Use "type": "object" for keyed JSON structures.

Core object keywords

KeywordWhat it does
propertiesDeclares named fields and their schemas
patternPropertiesApplies schemas to keys matching a regex
requiredLists fields that must be present
additionalPropertiesControls unknown keys
minPropertiesMinimum number of properties
maxPropertiesMaximum number of properties
propertyNamesSchema that every property name must satisfy
unevaluatedProperties is not supported right now. If you have a use case that requires it, reach out to us.

Example

{
  "type": "object",
  "properties": {
    "name": { "type": "string", "minLength": 1 },
    "age": { "type": "integer", "minimum": 0 },
    "email": { "type": "string", "format": "email" }
  },
  "required": ["name", "email"],
  "additionalProperties": false
}
Set additionalProperties: false when you want strict, predictable output shape.

patternProperties

Use regex-based key validation for dynamic maps:
JSON Schema
{
  "type": "object",
  "patternProperties": {
    "^S_[A-Z0-9]+$": { "type": "string" },
    "^I_[A-Z0-9]+$": { "type": "integer", "minimum": 0 }
  },
  "additionalProperties": false
}
Pydantic and Zod examples are omitted here because there is no direct keyword mapping for patternProperties.

title, description, default, and examples

Use annotation keywords to document intent and provide generation hints:
{
  "type": "object",
  "title": "Customer Profile",
  "description": "Customer profile returned by the extraction pipeline.",
  "default": {
    "name": "Unknown Customer",
    "email": "unknown@example.com"
  },
  "examples": [
    {
      "name": "Alice Johnson",
      "email": "alice@example.com"
    }
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Full legal name."
    },
    "email": {
      "type": "string",
      "format": "email",
      "examples": ["alice@example.com"]
    }
  },
  "required": ["name", "email"],
  "additionalProperties": false
}
These annotation keywords are ignored by structured generation and do not constrain the output. However, they can influence generation if they are included in the prompt.