tefra / xsdata

Naive XML & JSON Bindings for python
https://xsdata.readthedocs.io
MIT License
324 stars 59 forks source link

xsdata generate file.xsd fails: AttrsFilters.field_definition() missing 1 required positional argument #1045

Closed bicobus closed 4 months ago

bicobus commented 4 months ago

xsdata version 24.5

Trying to generate from and xsd file, which previously was working fine, generate this error:

  File ".venv/lib/python3.11/site-packages/xsdata/formats/dataclass/templates/class.jinja2", line 45, in top-level template code
    {%- set field_definition = obj|field_definition(attr, parent_namespace) %}
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AttrsFilters.field_definition() missing 1 required positional argument: 'parents'
tefra commented 4 months ago

Hi @bicobus can you try with the latest version of the xsdata-attrs? https://github.com/tefra/xsdata-attrs/releases/tag/v24.5

bicobus commented 4 months ago

Ah, that did it. For some reason, I depend on xsdata-attrs and only xsdata updated to v24.5. I guess because the major version changed.

Thanks for catching that.