Fix Outputted Model JSON Schema for Sequence type#9303
Merged
sydney-runkle merged 5 commits intopydantic:mainfrom Apr 28, 2024
Merged
Fix Outputted Model JSON Schema for Sequence type#9303sydney-runkle merged 5 commits intopydantic:mainfrom
sydney-runkle merged 5 commits intopydantic:mainfrom
Conversation
CodSpeed Performance ReportMerging #9303 will not alter performanceComparing Summary
|
Contributor
Author
|
please review |
davidhewitt
reviewed
Apr 23, 2024
Collaborator
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks for the fix! I have one thought, I wonder what you think of it?
davidhewitt
approved these changes
Apr 23, 2024
Collaborator
davidhewitt
left a comment
There was a problem hiding this comment.
This looks good to me, thanks!
Contributor
|
Thanks! Merging now :). |
evals-gic
pushed a commit
to evals-gic/pydantic
that referenced
this pull request
Feb 11, 2026
Add _get_schema_type_for_js_update() helper function to determine effective schema type for JSON schema constraint keys. Update min_length and max_length handlers to use minItems/maxItems for sequence types (list, tuple, set, frozenset, generator) and minLength/maxLength for text types (str, bytes, url, multi-host-url). Fixes pydantic#9303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Fixing an issue where the outputted JSON Schema, for the Sequence type, used
minLengthrather thanminItems.Fixed the same for
maxLength-maxItemsin advance.Provided tests for the relevant changes.
Related issue number
fix #9256
Checklist
Selected Reviewer: @davidhewitt