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.
Description
In
sdk/typescript/README.mdline 72, the documentation states:And the code example at line 81:
However, the
zod-to-json-schemapackage 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
sdk/typescript/README.md, lines 72 and 81sdk/typescript/samples/structured_output_zod.ts, line 17Suggested fix
Verify whether
"openAi"is actually supported by thezod-to-json-schemaversion used in this project. If not, update to the correct target value.