-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing derived types with multiple namespaces doesn't work for single-package style models #520
Comments
Here is the complete example just in case. |
The single package structure style doesn't work very well for derived types (aka xsi:type="eml23:IntegerExternalArray") when more than one namespaces is involved. docs If you notice on top of each module xsdata adds the source namespace the classes/types were originally declared. I suggest to switch to another structure style, if you picked the single package due to circular imports give the new Suggestions:
|
The xsdata/xsdata/formats/dataclass/parsers/json.py", line 131, in bind_dataclass
raise ParserError(f"Unknown property {clazz.__qualname__}.{key}")
xsdata.exceptions.ParserError: Unknown property AbstractIntegerArray.NullValue |
Roundtrips between json and xml also don't work all the time with derived/abstract types, you see the information We could make the parser attempt all possible classes, but that will also have some misses, in case more than one subclass fits the json properties. |
One another option could be to serialize into badgerFish json |
Hello,
I have an issue when I parse an xml into the classes previously generated.
My error is:
xsdata.exceptions.ParserError: Unknown property {http://www.energistics.org/energyml/data/resqmlv2}AbstractIntegerArray:{http://www.energistics.org/energyml/data/commonv2}NullValue
That is a simplified version of the schema:
And here is a sample xml file
I think the parser expects an
AbstractIntegerArray
and do not know what to do with theNullValue
.I am using master branch
The text was updated successfully, but these errors were encountered: