Skip to content

adapter.json: Non-deterministic array order in serialized JSON #573

Description

@thammel

JSON arrays that originate from unordered Python sets are serialized in non-deterministic order. Affected are the top-level object lists and set-valued attributes such as submodel and isCaseOf.

Expected behavior:
Serializing the same AAS twice produces byte-identical JSON, so output is reproducible across runs.

Actual behavior:
Array element order varies between runs. Set iteration order depends on hash randomization (PYTHONHASHSEED), so each serialization can emit a different ordering. This makes output non-reproducible — complicates diffing, caching, and snapshot testing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions