← 输入框|github.com|刷新
Skip to content

Have a validator's __call__ return the parsed json if no validation error is raised? #153

Open

Description

@jessekrubin

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?

Activity

  1. lelit commented on Feb 24, 2021

    @lelit
    Contributor

    Seems quite reasonable, yes 😉

  2. lelit commented on Feb 24, 2021

    @lelit
    Contributor

    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...

  3. jessekrubin commented on Mar 2, 2021

    @jessekrubin
    Author

    Pass on args and kwargs? Including the default method?

    I like the idea of validating and parsing in one swell foop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions