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'm trying to use the json-schema-to-zod npm package to generate Zod schemas for these schema but there's a lot of properties listed that are marked as having a default value of null but only have "type": "string" instead of "type": ["string", "null"].
For specific examples you can look at harmonized_tariff_code and country_of_origin in create_shipments_request_body.json.
This is causing an issue with the json-schema-to-zod package since the generated Zod schema gives a type error: Argument of type 'null' is not assignable to parameter of type 'string'.
country_of_origin: z
.string()
.min(2)
.max(2)
.default(null),
It would be really helpful if the nullable properties were updated to include null in their allowed types (or if they aren't actually nullable, then remove the default values).
The text was updated successfully, but these errors were encountered:
I'm trying to use the
json-schema-to-zod
npm package to generate Zod schemas for these schema but there's a lot of properties listed that are marked as having a default value ofnull
but only have"type": "string"
instead of"type": ["string", "null"]
.For specific examples you can look at
harmonized_tariff_code
andcountry_of_origin
increate_shipments_request_body.json
.This is causing an issue with the
json-schema-to-zod
package since the generated Zod schema gives a type error:Argument of type 'null' is not assignable to parameter of type 'string'.
It would be really helpful if the nullable properties were updated to include
null
in their allowed types (or if they aren't actually nullable, then remove the default values).The text was updated successfully, but these errors were encountered: