{
  "id": 3950170,
  "title": "5 Undocumented Rules for Gemini Structured Output, Measured in Production",
  "url": "https://urgent.news/2026/08/28/5-undocumented-rules-for-gemini-structured-output-measured-in",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-28T11:36:48.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/artyomsv/5-undocumented-rules-for-gemini-structured-output-measured-in-production-3mj"
  },
  "original_language": "en",
  "account": "Rule 1: Order the required properties of a schema as they appear in the required array, followed by optional properties in any order. The declaration order inside properties does not affect the order of required properties. This rule governs the correctness of the output, not just cosmetics. The order is empirical and not documented by Google. Measure the effect of the order on a specific model (gemini-3-flash-preview) and adjust as needed.\n\nRule 2: Before shipping a schema, count the total number of enum values across the entire schema. There is an undocumented ceiling on the total enum-value count. If the count exceeds this limit, Gemini will reject the schema. In production, the ceiling was found to be lower than expected.",
  "summary": "We run a document extraction pipeline on Gemini with a native responseSchema attached, not a \"please reply with JSON\" instruction in the prompt text. Over two months, three separate production problems traced back to behaviours of that schema that are not in Google's documentation. These are the rules we ship with now, and the measurement behind each one. The domain is anonymized (no client, no…",
  "key_points": [
    "Order required properties as per required array, then optional properties",
    "Measure order effect on gemini-3-flash-preview model, adjust if needed",
    "Enum value count limit exists, exceeded schemas rejected in production"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}