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

Perhaps add the option to prevent additional fields? #9

Open
monkybrain opened this issue Sep 20, 2018 · 0 comments
Open

Perhaps add the option to prevent additional fields? #9

monkybrain opened this issue Sep 20, 2018 · 0 comments

Comments

@monkybrain
Copy link

I've recently started using Skooma and love the clean syntax but I miss the option to prevent additional fields that you can find in other data validation libraries (e.g. json-schema). I've solved this by adding the extra step of asserting that Map.keys(data) == Map.keys(schema) but thought maybe this could be added as an option, e.g.

Skooma.valid? data, schema, additional_fields: false

Essentially adding Skooma.valid?/3 with this and potentially other options as the third argument.

If you like, I can also submit a PR with this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant