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

Support for prohibited keys #1110

Open
SohoPak opened this issue Oct 1, 2024 · 1 comment
Open

Support for prohibited keys #1110

SohoPak opened this issue Oct 1, 2024 · 1 comment

Comments

@SohoPak
Copy link

SohoPak commented Oct 1, 2024

Please consider adding support for prohibited keys in maps. This is similar to use = prohibited on attributes in xsd (see https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256143(v=vs.100) This is useful in validation scenarios when we want to accept open maps but explicitly specify certain keys this map should not contain (e.g. :error). I am aware of the built-in :fn schema, but IMHO adding the support to the built-in :map (similar to {:closed true}) would be cleaner.

@frenchy64
Copy link
Collaborator

FWIW more expressive constraints on absence of keys is planned for my Clojurists Together project.

The absence of a key will become a constraint that you can combine with and/or/implies etc.

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

No branches or pull requests

2 participants