• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 37140921914

03 Oct 2026 05:33PM UTC coverage: 90.088% (+0.2%) from 89.901%
37140921914

push

github

web-flow
Support nested collections (#833)

We allow the lists, the tuples and the sets to nest at any depth, *e.g.*,
``List[List[Tuple[Positive_int, Set[str]]]]``, and generate the code for
them in all the targets and schemas.

``Optional`` is allowed only at the top of a type annotation, since
the nested optionals can not be de/serialized in JSON and XML on many
targets. The items of the sets stay scalar. The mutability of
an argument is deep, so every level must be spelled alike:
``Sequence[Sequence[int]]`` or ``List[List[int]]``.

The type inference refuses ``==``, ``!=`` and ``in`` on lists, tuples
and sets, as the targets disagree on comparing them, and refuses deep
copies of lists and sets for now.

We copy the lists with ``list(...)`` instead of ``[:]``, since mypy
refuses to store the slice of a read-only ``Sequence`` as a ``List``.
For the same reason, we refuse to initialize a variable declared with
``List[...]`` with a read-only value:

    maybe_texts: Optional[List[str]] = optional_texts  # refused

The de/serializers are composed recursively, one function per container
type. In XML, the classes stay unwrapped, while the other items of
the lists and the sets are wrapped in ``<v>`` and the items of
the tuples in ``<v1>``, ``<v2>`` etc. at every level:

    <rowsOfPairs><v><v><v1>1</v1><v2><v>known</v></v2></v></v></rowsOfPairs>

We add the common meta-model ``nested_collections`` together with its
live test data, which check the round-trips and the paths of the errors
at every depth, *e.g.*, ``rowsOfPairs[0][1][0]``.

877 of 906 new or added lines in 39 files covered. (96.8%)

2 existing lines in 2 files now uncovered.

45189 of 50161 relevant lines covered (90.09%)

2.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.01
/aas_core_codegen/python/common.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc