Skip to content

Doc: SDK README uses incorrect case for zod-to-json-schema target value #18672

@hobostay

Description

@hobostay

Description

In sdk/typescript/README.md line 72, the documentation states:

You can also create a JSON schema from a Zod schema using the zod-to-json-schema package and setting the target to "openAi".

And the code example at line 81:

outputSchema: zodToJsonSchema(schema, { target: "openAi" }),

However, the zod-to-json-schema package does not have a "openAi" target option. The valid target values are "jsonSchema7", "jsonSchema2019-09", "openApi3", etc. The value "openAi" is not a recognized target.

If this is a custom target supported by the version used in this project, it should be documented as such. Otherwise, users copying this example will get unexpected behavior.

Location

  • File: sdk/typescript/README.md, lines 72 and 81
  • Also in sample: sdk/typescript/samples/structured_output_zod.ts, line 17

Suggested fix

Verify whether "openAi" is actually supported by the zod-to-json-schema version used in this project. If not, update to the correct target value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions