You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using toJSONSchema to generate an openapi schema for gemini and it is complaining that "type" is missing when using z.literal() compared to using v3 with zod-to-json-schema, I am not sure if this is intended, an oversight, or google's APIs are very picky. Here is an example of a simple json schema produced in v3 vs the same in v4 using z.toJSONSchema.
const is technical valid by itself so it seems Google is picky. In my own library I made the decision to always include type as a number of different libraries which rely on spec aren't always compliant. But to be fair to them, the spec can be iffy at times.
I am using toJSONSchema to generate an openapi schema for gemini and it is complaining that "type" is missing when using z.literal() compared to using v3 with zod-to-json-schema, I am not sure if this is intended, an oversight, or google's APIs are very picky. Here is an example of a simple json schema produced in v3 vs the same in v4 using z.toJSONSchema.
V3:
V4:
The text was updated successfully, but these errors were encountered: