Skip to content
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

Restrict / Validate deserialized values #123

Closed
Airblader opened this issue Mar 27, 2019 · 0 comments
Closed

Restrict / Validate deserialized values #123

Airblader opened this issue Mar 27, 2019 · 0 comments
Labels
Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish Status: Needs Design There is no clear API for this feature yet and one should be designed before work on ican be started Type: Feature If you want to add something that doesn't exist yet

Comments

@Airblader
Copy link
Collaborator

What's your idea?

A common use-case is that there's only a discrete set of possible values for a parameter, but validating this is currently only possible by providing a custom deserializer which can then convert invalid values into some fallback value or similar.

We should evaluate whether a more direct approach for this could be useful, and if so, what it could look like. Some ideas:

  1. Make baking this into a deserializer easier through some factory method.
  2. Provide a restrictTo kind of option which requires & uses the already existing compareWith function
  3. Provide a separate validation function
  4. …?
@Airblader Airblader added Type: Feature If you want to add something that doesn't exist yet Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish Status: Needs Design There is no clear API for this feature yet and one should be designed before work on ican be started labels Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish Status: Needs Design There is no clear API for this feature yet and one should be designed before work on ican be started Type: Feature If you want to add something that doesn't exist yet
Projects
None yet
Development

No branches or pull requests

1 participant