Gemini Structured Output Profile
Table of Contents
- Source
- Documented Requirements
- Profile Files
- Requirement Reference Enums
- Notes
- Validation That Must Run In Code
This page captures the JSON Schema subset documented by Google for Gemini structured output.
Source
- Google Gemini docs: Structured output - JSON Schema support
- Profile baseline version: 202602 (February 2026)
- Upstream page update shown by Google: February 26, 2026 (UTC)
Documented Requirements
Supported schema keyword groups
- Type values:
string,integer,number,boolean,array,object,null - Generic fields:
title,description string:enum,formatintegerandnumber:format,minimum,maximum,enumarray:minItems,maxItems,items,prefixItemsobject:properties,required,propertyOrdering,additionalProperties
Nullability
- A nullable field uses a type array containing
null, for exampletype: ["string", "null"].
Model behavior note for property order
- The docs state that Gemini API and SDK preserve schema property ordering.
- For Gemini 2.0 and earlier, examples and schemas should include
propertyOrdering[].
Language vs model differences
- The documented JSON Schema subset is API-level and is not different by SDK language.
- SDKs can provide different helpers (for example class/type wrappers), but the transmitted schema restrictions are the same.
- The documented difference is model-generation behavior (not SDK language), specifically the Gemini 2.0
propertyOrderingrequirement note above.
Profile Files
- gemini_202602.yaml: baseline Gemini documented subset.
- gemini_202503.yaml: stricter Gemini 2.0 profile that requires
propertyOrderingon object schemas.
Requirement Reference Enums
GEMINI_202602GEMINI_202503- older version for Gemini 2.0 models
Notes
- The profile schema encodes only the subset explicitly documented on the linked page.
- This profile intentionally stays conservative where the page does not explicitly document additional JSON Schema keywords.
Validation That Must Run In Code
Even when a schema passes gemini_202602.yaml, additional checks are still useful in application code:
- If targeting Gemini 2.0 or earlier, enforce project policy that object schemas include
propertyOrdering. - When
propertyOrderingis present, verify every name exists inpropertiesand that no duplicate names are present. - Validate semantic consistency between
requiredandproperties(every required field is declared as a property). - Apply model-target checks at runtime because support details can differ by model generation even within the documented keyword subset.
For Gemini 2.0 targets, prefer validating against gemini_202503.yaml first, then run model-target checks in code.