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.
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.
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