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

eclipse-aascw / aas-core-codegen / 35260547425
90%

Build:
DEFAULT BRANCH: main
Ran 17 Sep 2026 06:47PM UTC
Jobs 3
Files 264
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Sep 2026 06:43PM UTC coverage: 85.647% (+0.002%) from 85.645%
35260547425

push

github

web-flow
Compose the Python JSON serialization (#709)

Every concrete class carried a ``transform_<cls>`` method on the
``_Serializer``, and every nested value in it went through
``self.transform``, which is three Python frames: the ``transform`` of
the transformer, the ``transform`` of the instance, and the method which
finally writes the properties. The framing of a list was spelled out at
each list-typed properties. A class now costs one module-level function
plus an entry in the transformer:

    def _submodel_element_collection_to_jsonable(
        that: aas_types.SubmodelElementCollection
    ) -> MutableMapping[str, MutableJsonable]:
        """Serialize :paramref:`that` to a JSON-able representation."""
        jsonable: MutableMapping[str, MutableJsonable] = dict()
        if that.extensions is not None:
            jsonable['extensions'] = _list_of__extension_to_jsonable(
                that.extensions
            )
        if that.category is not None:
            jsonable['category'] = that.category
        ...
        if that.value is not None:
            jsonable['value'] = _list_of__submodel_element_to_jsonable(
                that.value
            )
        jsonable['modelType'] = 'SubmodelElementCollection'
        return jsonable

The rationale and the design, dual to the de-serialization:

* One shape for every serializer, ``value 🠒 JSON-able value``. As on the
  reading side, and unlike the XML side, the serializers need no
  combinator tower: a JSON value is not framed by anything which
  encloses it, so the value at a key already is the whole value, and
  only a list and a tuple have to be composed at all.

* The composed serializers are de-duplicated by the type which they
  serialize and are named out of the same monikers as the parsers,
  so that ``_list_of__reference_to_jsonable`` stands beside
  ``_list_of__reference_from_jsonable``. They are module-level
  functions, so nothing whatsoever is composed at the time of the
  seriali... (continued)

140 of 159 new or added lines in 1 file covered. (88.05%)

34316 of 40067 relevant lines covered (85.65%)

2.57 hits per line

Uncovered Changes

Lines Coverage ∆ File
19
93.03
-0.98% aas_core_codegen/python/lib/_generate_jsonization.py
Jobs
ID Job ID Ran Files Coverage
1 3.11 - 35260547425.1 17 Sep 2026 06:50PM UTC 264
85.65
GitHub Action Run
2 3.10 - 35260547425.2 17 Sep 2026 06:50PM UTC 264
85.65
GitHub Action Run
3 3.12 - 35260547425.3 17 Sep 2026 06:50PM UTC 264
85.65
GitHub Action Run
Source Files on build 35260547425
  • Tree
  • List 264
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • f71fbc15 on github
  • Prev Build on main (#35255278886)
  • Next Build on main (#35266621951)
  • Delete
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