StefanTerdell / zod-to-json-schema

Converts Zod schemas to Json schemas
ISC License
886 stars 71 forks source link

feat: Support for z.literal(null) #120

Closed JeongJuhyeon closed 4 months ago

JeongJuhyeon commented 5 months ago

Currently, z.literal(null) gets translated to {"type": "object"} which isn't very representative. Not sure if this is the right way to go about it, I just went with the most obvious modification.

StefanTerdell commented 5 months ago

@JeongJuhyeon Oh, this is definately a bug! Nice catch. Would you mind adding a test?

StefanTerdell commented 4 months ago

Note to self: this broke tests so was force pushed from the main branch after optimistic merge