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
{{ message }}
Repository navigation
Have a validator's __call__ return the parsed json if no validation error is raised? #153
It would be nice if I could validate and loads a json string/bytes in one swell foop. Assuming that the validator must parse the json when performing validation, it should be pretty easy to return the parsed results post validation, right?
Thinking a bit more, I'm not sure it would be the right thing to do: I mean, the validation does not parse the JSON stream into Python objects, so that requires an extra step anyway; and generally you want to specify some option, or even a custom decoder...
Activity
lelit commentedon Feb 24, 2021
Seems quite reasonable, yes 😉
lelit commentedon Feb 24, 2021
Thinking a bit more, I'm not sure it would be the right thing to do: I mean, the validation does not parse the JSON stream into Python objects, so that requires an extra step anyway; and generally you want to specify some option, or even a custom decoder...
jessekrubin commentedon Mar 2, 2021
Pass on args and kwargs? Including the default method?
I like the idea of validating and parsing in one swell foop.