The 2 biggest ways I can see developers shooting t...
# proj-sdk
s
The 2 biggest ways I can see developers shooting their own foot off with this are: • Using
BaseModel
instead of
DiscriminatedFieldsMixin
and then wondering why the schema for the model does not update with polymorphic fields... e.g.: For a polymorphic class
Animal
Bad: (The schema on this will not update as new Animals are Loaded...)
Copy code
class Pack(BaseModel):
  members: list[Animal]
Better but Ugly: (The schema on this will update):
Copy code
class Pack(DiscriminatedFieldsMixin):
  members: list[Animal]
• Using an incompatible
ConfigDict
- for example if you create a Polymorphic subclass with
extra="allow"
then I imagine that the system could get confused.