Closed diogob closed 1 year ago
@diogob now I realize that on
objectSchema
andundefinedSchema
, in case of failure, it should return aPromise<ParserIssue[]>
instead of throwing, as they are using a safe method:safeParseAsync
And we should also document it ;)
Great catch! I'm glad we never rush merges :P
I'm getting pretty excited about this PR tho
@gustavoguichard I have added a small note on the README, we can expand it with examples in future PRs. It seems we are ready to merge now.
Decoupling from zod yields a clearer typing IMHO. It will also allow anyone to build adapters for any validator as long as they abide by zod's
safeParseAsync
and issues interface.The long term goal is to track Zod's interface keeping this library always as our de facto standard parser. The additional burden on type maintenance should be minimal considering these interfaces have a small surface area and are quite fundamental to Zod's backwards compatibility.
TODO