IGeminiSchema is a type schema info for Gemini function calling,
implemented according to the official Gemini guide documentation
specification.
IGeminiSchema basically follows the JSON schema definition of the OpenAPI
v3.1 specification; OpenApiV3_1.IJsonSchema. Although Gemini had
significant limitations in earlier versions (prior to 2025-11-05), it now
supports nearly all JSON schema features including union types, reference
types, and various constraint properties.
In earlier versions, Gemini blocked virtually all JSON schema specifications
such as anyOf, $ref, format, maxItems, making function calling
practically impossible. However, these limitations have been removed in recent
updates.
IGeminiSchema provides a type definition that strictly follows the Gemini
official specification.
Here is the list of how IGeminiSchema is different with the OpenAPI v3.1
JSON schema:
Specified not only by the official documentation, but also by
experimental validation. Therefore, definitions may be inaccurate or
change in the future. If you find wrong or outdated definitions,
please report via issue.
Type schema info for Gemini function calling.
IGeminiSchemais a type schema info for Gemini function calling, implemented according to the official Gemini guide documentation specification.IGeminiSchemabasically follows the JSON schema definition of the OpenAPI v3.1 specification; OpenApiV3_1.IJsonSchema. Although Gemini had significant limitations in earlier versions (prior to 2025-11-05), it now supports nearly all JSON schema features including union types, reference types, and various constraint properties.In earlier versions, Gemini blocked virtually all JSON schema specifications such as
anyOf,$ref,format,maxItems, making function calling practically impossible. However, these limitations have been removed in recent updates.IGeminiSchemaprovides a type definition that strictly follows the Gemini official specification.Here is the list of how
IGeminiSchemais different with the OpenAPI v3.1 JSON schema:Compared to OpenApi.IJsonSchema, the emended JSON schema specification:
For reference, if you compose the
IGeminiSchematype with the IGeminiSchema.IConfig.referencefalseoption (default isfalse), only recursively named types are archived into the IGeminiSchema.IParameters.$defs, and others are escaped from the IGeminiSchema.IReference type.