{"id":246170,"date":"2025-11-05T23:01:09","date_gmt":"2025-11-05T23:01:09","guid":{"rendered":"https:\/\/www.newsbeep.com\/uk\/246170\/"},"modified":"2025-11-05T23:01:09","modified_gmt":"2025-11-05T23:01:09","slug":"google-announces-support-for-json-schema-and-implicit-property-ordering-in-gemini-api","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/uk\/246170\/","title":{"rendered":"Google announces support for JSON Schema and implicit property ordering in Gemini API."},"content":{"rendered":"<p data-block-key=\"4k5q4\">Today, we&#8217;re announcing enhancements to <a href=\"https:\/\/ai.google.dev\/gemini-api\/docs\/structured-output\" rel=\"nofollow noopener\" target=\"_blank\">Structured Outputs in the Gemini API<\/a>, with expanded support for JSON Schema and better adherence to property ordering in the output.<\/p>\n<p data-block-key=\"2pfuq\">Structured Outputs enable AI models to generate responses that guarantee adherence to a specific schema, which is important for tasks like data extraction and database population. They are also important for agent communication: one agent\u2019s output becomes another\u2019s formatted input, enabling complex multi-agent systems to collaborate without translation layers.<\/p>\n<p>Expanded JSON Schema support<\/p>\n<p data-block-key=\"d3qlf\">We\u2019ve now added <a href=\"https:\/\/ai.google.dev\/gemini-api\/docs\/structured-output?example=recipe#json_schema_support\" rel=\"nofollow noopener\" target=\"_blank\">support for JSON Schema<\/a> to all actively supported Gemini models. This enables libraries like <a href=\"https:\/\/docs.pydantic.dev\/latest\/\" rel=\"nofollow noopener\" target=\"_blank\">Pydantic<\/a> (Python) or <a href=\"https:\/\/zod.dev\/\" rel=\"nofollow noopener\" target=\"_blank\">Zod<\/a> (JavaScript\/TypeScript) to work out-of-the-box with the Gemini API. It builds upon the current support for the Gemini API\u2019s <a href=\"https:\/\/ai.google.dev\/api\/caching#Schema\" rel=\"nofollow noopener\" target=\"_blank\">Schema<\/a> object that is based on <a href=\"https:\/\/spec.openapis.org\/oas\/v3.0.3.html\" rel=\"nofollow noopener\" target=\"_blank\">OpenAPI 3.0<\/a> for Structured Outputs and Function Calling.<\/p>\n<p data-block-key=\"a9sjb\">This update also adds support for frequently requested JSON Schema keywords, including:<\/p>\n<p>anyOf for conditional structures (Unions)$ref for recursive schemasminimum and maximum for numeric constraintsadditionalProperties and type: &#8216;null&#8217;prefixItems for tuple-like arraysImplicit property ordering<\/p>\n<p data-block-key=\"brns3\">One of the important updates we have made is that the API now preserves the same order as the ordering of keys in the schema. This is supported for all Gemini 2.5 models and beyond and also applies to our <a href=\"https:\/\/ai.google.dev\/gemini-api\/docs\/openai\" rel=\"nofollow noopener\" target=\"_blank\">OpenAI compatibility API<\/a>. You can see this in action in this content moderation example using Pydantic:<\/p>\n","protected":false},"excerpt":{"rendered":"Today, we&#8217;re announcing enhancements to Structured Outputs in the Gemini API, with expanded support for JSON Schema and&hellip;\n","protected":false},"author":2,"featured_media":246171,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[554,733,4308,3085,86,56,54,55],"class_list":{"0":"post-246170","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-artificial-intelligence","8":"tag-ai","9":"tag-artificial-intelligence","10":"tag-artificialintelligence","11":"tag-none","12":"tag-technology","13":"tag-uk","14":"tag-united-kingdom","15":"tag-unitedkingdom"},"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts\/246170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/comments?post=246170"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts\/246170\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/media\/246171"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/media?parent=246170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/categories?post=246170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/tags?post=246170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}