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

Create a stand alone schema function reducer #442

Open
acatl opened this issue Oct 16, 2019 · 0 comments
Open

Create a stand alone schema function reducer #442

acatl opened this issue Oct 16, 2019 · 0 comments

Comments

@acatl
Copy link
Collaborator

acatl commented Oct 16, 2019

Problem description:

With the newer version of data-point, we expect the Schema entity to be removed from the set of entities offered by data-point core package.

Suggested solution:

Create a new package that exposes a function reducer that implements ajv's schema functionality.

The API would be a higher-order function that accepts a compatible schema Object and that returns a function that will run the compiled schema against the value received.

If the schema fails to pass, then throw an error with as much information as possible provided by ajv's error object.

If there is no error, then return the value that was originally passed.

@acatl acatl added this to the v6 Feature Complete milestone Oct 16, 2019
@acatl acatl self-assigned this Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant