-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial decoding using Regex/Seqexp #387
Comments
This might be hard (or not). IMHO we should not make any guarantees about how (partially) invalid input is decoded. (Ceterum censeo, it should produce an error but that is not on the roadmap.) |
Sorry for the long delay, I've been flooded with work. I'm not sure why this would be difficult, but perhaps I'm missing some context on how decoders work? |
We would have to keep the longest partial decoding around and then return that if the full sequence cannot be decoded. Maybe not super difficult but definitely additional complexity and reduced performance and usually the input has (or should have) been validated beforehand anyway. I would rather have #404. |
Either way works, in fact a coercer may even be better because at the end of the day, I'm getting stringified data and I'd like to be able to get the correct error reported for fn schemas and schemas with custom errors. |
Ah I might have it the wrong way around, in that case you would first decode and then validate... still I think the coercer would be more optimal. Either way quite a bit of work to improve the errors. |
Right now the implementation of
:catn
has it so that the following example doesn't decode "1.0" ifTestEnum
fails:I was wondering if there were any plans to support partial decoding?
The text was updated successfully, but these errors were encountered: