xsdata-pydantic icon indicating copy to clipboard operation
xsdata-pydantic copied to clipboard

Ensure model_fields is called on a BaseModel subclass

Open ocktowen opened this issue 4 months ago • 0 comments

📒 Description

In some cases get_fields receives an instance of a pydantic model. Accessing the model_fields attribute from the instance is deprecated and it should be accessed from the class.

🔗 What I've Done

I added an extra check to ensure the obj is always a class.

🛫 Checklist

  • [ ] Updated docs
  • [ ] Added unit-tests

ocktowen avatar Aug 21 '25 12:08 ocktowen