Closed miguelrk closed 7 months ago
HI, @miguelrk I'm working on the zod
compatibility API. Unfortunately, not everything can be 1-1 matched. I suppose the 1.0.0
version will satisfy Zod
portability API
First of all thanks for the quick answer! That's great to hear! Looking forward to 1.0.0
.. I understand not everything can be 1-1 matched (by design) since this library should adhere to the JSON schema spec first and foremost, but aligning to the zod
API I think would indeed allow integrating with the zod ecosystem, right? Not sure if it will work in practice, but at least conceptually I wouldn't see why it wouldn't...
conceptually it can work, will see in practice, right? I'll close the issue now since #35 has already been created to track the progress of API compatibility.
I understand that the
ajv-ts
API is a subset of the largerzod
API by design, sinceajv-ts
should only support what is defined in JSON schema, and not the extra stuffzod
adds. However, it would be great for this library to achieve 100% compatibility with the zod API in what they do have in common. This would allow usingajv-ts
as a drop-in replacement forzod
for the vast ecosystem ofzod
packages. For example,auto-form
should ideally simply work:Expected Result:
However, this is throwing errors since the
ajv-ts
schema does not match the samezod
schema (thes.object()
has another form thanz.object()
).Would this compatibility desired? This could be a good design decision (to align 100% with
zod
) in order to benefit from its vast ecosystem.