-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
docs: include documentation for BaseModel.model_validate_strings #9506
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
docs: include documentation for BaseModel.model_validate_strings #9506
Conversation
CodSpeed Performance ReportMerging #9506 will not alter performanceComparing Summary
|
4bba640 to
cebfebc
Compare
|
please review |
sydney-runkle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch includes documentation for BaseModel.model_validate_strings() introduced in #7552 to the docs build.
Amazing, thanks! Great work here.
Background on the validate_strings() feature is discussed in #7549 and #8736 in particular. Is a more detailed explanation necessary, especially to show the differences between the three validation helpers on BaseModel?
I don't think we need something much more in depth, though perhaps we could pull a bit of info from:
The pydantic-core stubs have _StringInput = dict[str, _StringInput] as type annotation for the object to validate. Since the pydantic implementation fully delegates to pydantic-core, only dicts are actually allowed. Should the annotation in pydantic be updated?
What are you suggesting we update the annotation to? Feel free to make the change, and I can review in context!
Ping me when you'd like another review :).
|
Hi @airwoodix, Let me know if you have any other questions about the above notes! |
sydney-runkle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a few minor wording changes - looks good otherwise!
Change Summary
This patch includes documentation for
BaseModel.model_validate_strings()introduced in #7552 to the docs build.Background on the
validate_strings()feature is discussed in #7549 and #8736 in particular. Is a more detailed explanation necessary, especially to show the differences between the three validation helpers onBaseModel?The
pydantic-corestubs have_StringInput = dict[str, _StringInput]as type annotation for the object to validate. Since thepydanticimplementation fully delegates topydantic-core, only dicts are actually allowed. Should the annotation inpydanticbe updated?Checklist
Selected Reviewer: @samuelcolvin