Skip to content
Snippets Groups Projects

Improve/xml deserialization

Merged Leon Mauritz Möller requested to merge improve/xml_deserialization into master

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)

Edited by Leon Mauritz Möller

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Michael Thies
  • Michael Thies
  • Michael Thies
  • Michael Thies
  • Michael Thies
  • Michael Thies
  • @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.

  • added 1 commit

    • 6b64c17a - make failsafe and stripped class variables

    Compare with previous version

  • added 1 commit

    • f05fd35a - raise ValueError in read_aas_xml_element(), if none of the previous cases match

    Compare with previous version

  • added 1 commit

    • 3f358cfb - adjust error message example in module docstring

    Compare with previous version

  • added 3 commits

    • 6476e8f9 - adapter.xml.xml_deserialization: make failsafe and stripped class variables
    • da71c0bb - adapter.xml.xml_deserialization: raise ValueError in read_aas_xml_element(),...
    • ca847eaf - adapter.xml.xml_deserialization: adjust error message example in module docstring

    Compare with previous version

  • added 1 commit

    • 447438dc - adapter.xml.xml_deserialization: change type_ to Referable

    Compare with previous version

  • Recent changes LGTM.

  • added 1 commit

    • 395d6593 - model: change key type of KEY_ELEMENTS_CLASSES to Type[Referable]

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading