Gemini · responseSchema
Gemini's responseSchema is a subset of JSON Schema
Gemini rejects a schema with Unknown name when it contains a keyword outside its supported subset — most often $ref, but also pattern, minLength, and others. The fix is to inline and strip what Gemini doesn't understand.
What the error means
Unlike OpenAI (which validates a strict superset) or Anthropic (which takes ordinary JSON Schema), Gemini's responseSchema accepts only a defined subset of fields. Any keyword outside that subset isn't ignored — it's a hard 400 INVALID_ARGUMENT. The usual culprits:
The fix
Inline any $ref so the referenced definition is written out in place, and remove the keywords Gemini can't parse. Keep the structural fields it does support — type, properties, items, required, enum, nullable, and propertyOrdering.
Bonus: stable field order
Gemini decides output field order from propertyOrdering. Without it, order is unpredictable and can hurt output quality — so the converter adds it to every object automatically.
Fix it automatically
Paste your schema, pick Gemini, and the converter inlines $ref, drops unsupported keywords, and adds propertyOrdering — listing each change with the doc rule behind it. Runs entirely in your browser.
Gemini structured output docs ↗