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

Refined: Treat fields with NonEmpty or MinSize(>0) as required #3839

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

kciesielski
Copy link
Member

Fixes #3828

  • Schemas for types with refined constrains MinSize, MaxSize and NonEmpty will now get proper non-custom validators, translated to minItems and maxItems properties in specs.
  • Schemas for types validated with MinSize will now be marked as required (optional = false)

Example fields:

    nicknames: List[String Refined (MinSize[3] And MaxSize[6])] Refined NonEmpty,
    nicknames2: List[String Refined MinSize[4]] Refined (MaxSize[7] And MinSize[2]),
    nicknames3: List[String] Refined MaxSize[50]

Docs:
image

@kciesielski kciesielski requested a review from adamw June 12, 2024 14:11
@kciesielski kciesielski marked this pull request as ready for review June 12, 2024 14:11
@kciesielski kciesielski merged commit 55e84df into master Jun 13, 2024
26 checks passed
@kciesielski kciesielski deleted the fix-refined-nonempty branch June 13, 2024 13:02
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

Successfully merging this pull request may close these issues.

[BUG] In documentation collection refined as NonEmpty does not appear as required
2 participants