tefra / xsdata

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

NeTEx scherma with compound fields causes errors #532

Closed skinkie closed 3 years ago

skinkie commented 3 years ago
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `all` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `noneRequired` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `always` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `both` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `anyone` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `passenger` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `AND` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `EQ` to one of []
  warnings.warn(
/mnt/storage/home/skinkie/Sources/xsdata/xsdata/formats/converter.py:82: ConverterWarning: Failed to convert value `route` to one of []
  warnings.warn(
tefra commented 3 years ago

Thanks for reporting @skinkie, there are multiple issues with compound fields and multi-inheritance models

tefra commented 3 years ago

Hey @skinkie, this issue brought up one of my white whales, a scenario that I was pretty sure I would never come across, class/subclass with multiple repeatable choices. It required to rethink the analyzer steps a bit and to refactor some old restrictions handling.

It should work now

skinkie commented 3 years ago

And now you expect end-user to test it ;-) With pleasure. But to be clear, the architecture guys may have modeled everything in impossible ways, I still have to come across a real life example of its usage ;-)

tefra commented 3 years ago

I am using the example from the NeTEx to test rountrip conversions and validate against the schema, I did some manual sampling and qa but yeah as always your feedback is the most important.