[Pydantic 2 only] Serialize query lookups with pydantic_core
based on the provided schema
#43
Labels
pydantic_core
based on the provided schema
#43
Since Pydantic v2, it looks feasible to walk through the what-is-called
CoreSchema
, which is used bypydantic_core
to perform the data validation/serialization.This opens up the door to get rid of
DjangoJSONEncoder
, which the only responsibility left in0.3.*
is to serialize lookup parameters. It's still not possible to perform a partial model serialzation right out of the box (especially if we're talking about nested schemas), but at least now we could traverse inner structure through the model's core schema, extract particular schema definition for the lookup and perform a serialization with it.The text was updated successfully, but these errors were encountered: