Improve/xml deserialization
This merge request adds the customizing pattern from the json serialization to the xml serialization - which is now not necessary anymore for it's original usecase, but will be useful for parsing stripped xml elements in the http api.
Furthermore, the functions read_aas_xml_file_into()
and read_aas_xml_element()
were added. read_aas_xml_element()
should originally accept a type and a decoder class, but because mypy doesn't narrow down type variables for if type_ is SomeType
and the issue was still present with if issubclass(type_, SomeType)
, despite it narrowing down the type, I decided to change the API and just pass a constructor function to it, as I think that it is prettier than telling mypy to ignore the type at the end of each line.
see #63 (closed) #91
fixes #74 (closed)
Merge request reports
Activity
mentioned in merge request !58 (merged)
- Resolved by Leon Mauritz Möller
- Automatically resolved by Leon Mauritz Möller
- Resolved by Leon Mauritz Möller
- Automatically resolved by Leon Mauritz Möller
- Resolved by Leon Mauritz Möller
- Automatically resolved by Leon Mauritz Möller
- Resolved by Leon Mauritz Möller
@leon.moeller: How is your progress on the issues above? I'd like to get this branch merged, especially for the minor change for
Qualifier
objects.- Resolved by Michael Thies
- Resolved by Leon Mauritz Möller
- Resolved by Leon Mauritz Möller
added 1 commit
- f05fd35a - raise ValueError in read_aas_xml_element(), if none of the previous cases match
added 1 commit
- 3f358cfb - adjust error message example in module docstring
added 1 commit
- 447438dc - adapter.xml.xml_deserialization: change type_ to Referable
added 1 commit
- 395d6593 - model: change key type of KEY_ELEMENTS_CLASSES to Type[Referable]