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

allow empty values with minlength & allowed rules #238

Merged
merged 7 commits into from
Nov 27, 2024
Merged

Conversation

zargot
Copy link
Collaborator

@zargot zargot commented Nov 19, 2024

Copy link
Collaborator

@yulric yulric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. What's the reason for updating the schema and schema additions files in the module-functions folder?
  2. Can you explain why you're using anyof rather than just including empty = True directly?

src/odm_validation/rules.py Show resolved Hide resolved
src/odm_validation/rules.py Show resolved Hide resolved
@zargot
Copy link
Collaborator Author

zargot commented Nov 22, 2024

  1. What's the reason for updating the schema and schema additions files in the module-functions folder?
  2. Can you explain why you're using anyof rather than just including empty = True directly?
  1. to make the tests run
  2. i'm using anyof because I want "x is in the set of allowed values OR empty". Otherwise it would be AND I think. Otherwise it would trigger the empty rule even when the value is in the set of allowed values.

Base automatically changed from validate-cmd to dev November 27, 2024 15:35
- src:
    - rules.py: use `anyof` to include empty values
    - {reports, rule_errors}.py: extract relevant constraint from
      `anyof` for error msg
- assets:
    - update validation schemas and test data
@zargot zargot merged commit cc1df35 into dev Nov 27, 2024
3 checks passed
@zargot zargot deleted the 226-227-empty branch November 27, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants