Closed http403 closed 1 year ago
@http403 I just ran into this issue myself - the pydantic validator bindings need to get loaded first before you can instantiate the model.
There are two side effects here actually - xsdata-pydantic becomes a project dependency in order to run it (likely a minor issue) and you need to make sure you do something to trigger loading of xsdata_pydantic.bindings before the model is instantiated.
I myself have the model saved within a larger package so I just added a dummy import xsdata_pydantic.bindings
to the init.py file above it.
@bryan-hunt thanks for finding the solution. I moved to use xsdata-attrs instead. I will close this issue.
I generated a model for KML file but I got an no validator found exception.
To reproduce
Run
Output
However, I do saw a
make_validators()
forXmlPeriod
was called inxsdata_pydantic/compact.py
. I tried set a breakpoint there but it wasn't triggered.