GetterDict / Pydantic v2 #738
SmileyChris
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
@SmileyChris yeah,
Well Ideally i would keep doted aliases as there are some companies/projects use it alot - and it would be nice if they migrate to pydantic2 without any codebase change (maybe even both aliased-paths and doted can work together) / or with some slow deprecation procedure... |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Following on from discussion in #396 )
A
root_validator(pre=True)
decorated on the theSchema
base class can do everything_convert_result
does.If you wanted, a basic version of resolvers might work there too: use the validator classmethod to just look for
resolve_[x]
methods directly. This, combined with my understanding of how validation context works means we could pass the original object as context and pass this on to the resolver objects, yeah? It's fancy what we're doing withself
on resolvers, but I don't know if it's that necessary to reimplement that initially (it's easy just having them asstaticmethod
s that receive the obj).Also, with v2's aliased paths, I don't really think we need any magic dotted alias, since this comes out of the box now.
Beta Was this translation helpful? Give feedback.
All reactions