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
amazing library, happy to see something being to actively developed.
More a question since it's not clear from the README documentation.
In the documentation it says that a z.union translates into allOf (unless globally configured to oneOf through the unionOneOf setting).
I think this should be changed to anyOf as the code suggests.
My actual question:
In my case I need to (for compatability reasons) create an allOf schema, which consists of multiple refs and some custom type.
I get a ref for Base1, but since .shape flattens Base2 the openapi information gets lost, so Base2 and the last z.object get merged inline into MySchema.
Is there a different way of constructing the openapi schema above (with the allOf refs) that I did not see?
The text was updated successfully, but these errors were encountered:
Hi Sam,
amazing library, happy to see something being to actively developed.
More a question since it's not clear from the README documentation.
In the documentation it says that a z.union translates into
allOf
(unless globally configured tooneOf
through theunionOneOf
setting).I think this should be changed to
anyOf
as the code suggests.My actual question:
In my case I need to (for compatability reasons) create an
allOf
schema, which consists of multiple refs and some custom type.I tried to get this by using extend as mentioned in the docs.
But the multiple refs are a problem, because when doing this:
I get a ref for
Base1
, but since.shape
flattensBase2
the openapi information gets lost, soBase2
and the lastz.object
get merged inline intoMySchema
.Is there a different way of constructing the openapi schema above (with the allOf refs) that I did not see?
The text was updated successfully, but these errors were encountered: