You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adapter.json: Non-deterministic array order in serialized JSON #573
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.
Personally, I think it'd be a good feature to have consistent outputs.
However, the specification of the AAS defines the output as unordered (we have discussed this several times already), so you cannot guarantuee order when getting AAS files elsewhere. Semantic comparision of AAS data is a complex question.
I will mark this as a discussion for the future, since I can't currently see how complex this would be to implement (nor if it would produce backward incompatible changes).
Edit: Just saw that you already provided a fix. I'll review it and let's see if there's any complicating issues.
Activity
s-heppner commentedon Jun 19, 2026
What's your use-case?
Personally, I think it'd be a good feature to have consistent outputs.
However, the specification of the AAS defines the output as unordered (we have discussed this several times already), so you cannot guarantuee order when getting AAS files elsewhere. Semantic comparision of AAS data is a complex question.
I will mark this as a discussion for the future, since I can't currently see how complex this would be to implement (nor if it would produce backward incompatible changes).
Edit: Just saw that you already provided a fix. I'll review it and let's see if there's any complicating issues.
adapter.json: Add opt-in deterministic JSON array order
Implement constant order in JSON serialization
sdk/server: Implement JSON serialization formats (#660)