GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — genaiSchemaToJsonSchema | ADK for TypeScript: API Reference - v2.5.0

  • genaiSchemaToJsonSchema

Function genaiSchemaToJsonSchema

  • genaiSchemaToJsonSchema(schema: Schema): Record<string, unknown>

    Converts a genai Schema into a standard JSON Schema object.

    This is the inverse of zodObjectToSchema, which renders Zod into the genai/OpenAPI dialect. The two dialects differ in four ways, all handled here:

    • type is an uppercase enum (STRING) rather than a JSON Schema type name (string). TYPE_UNSPECIFIED means "no constraint" and is dropped.
    • nullable: true widens the type, which JSON Schema expresses as a type union (['string', 'null']).
    • Count and length bounds are stringified (maxItems: '5').
    • propertyOrdering and example have no JSON Schema equivalent.

    Everything else (description, title, default, pattern, required, minimum, maximum, format) is already JSON-Schema-shaped and passes through, with items, properties and anyOf converted recursively.

    Parameters

    • schema: Schema

    Returns Record<string, unknown>

    • Defined in core/src/utils/genai_schema_to_json.ts:57
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.