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
XMLCoder currently does not guarantee deterministic ordering of root XML attributes during encoding. This makes encoded XML output unstable across runs and complicates snapshot testing or byte-for-byte comparisons.
Note
This issue was generated using AI tooling.
Problem
When doing encoding tests for XML, I need to disable inclusion of rootAttributes for testing because their ordering is not deterministic.
For example, the same encoded object may produce different attribute ordering between runs:
Encoded XML attribute ordering should be deterministic across runs.
Possible solutions could include:
Preserving insertion order
Sorting attributes before serialization
Providing a configurable ordering strategy
Impact
This affects:
Snapshot testing
Byte-for-byte output comparisons
Reproducible build workflows
Stable XML fixture generation
It also forces downstream consumers to omit root attributes during tests, reducing test coverage of the final encoded XML output.
Additional Context
I understand XML attribute order is not semantically meaningful according to the XML specification. However, deterministic output is still important for testing and reproducibility purposes.
Summary
XMLCodercurrently does not guarantee deterministic ordering of root XML attributes during encoding. This makes encoded XML output unstable across runs and complicates snapshot testing or byte-for-byte comparisons.Note
This issue was generated using AI tooling.
Problem
When doing encoding tests for XML, I need to disable inclusion of
rootAttributesfor testing because their ordering is not deterministic.For example, the same encoded object may produce different attribute ordering between runs:
and:
Even though these are semantically equivalent XML documents, the resulting byte output differs, which causes snapshot or equality-based tests to fail.
Currently, I need to use a workaround similar to:
Expected Behavior
Encoded XML attribute ordering should be deterministic across runs.
Possible solutions could include:
Impact
This affects:
It also forces downstream consumers to omit root attributes during tests, reducing test coverage of the final encoded XML output.
Additional Context
I understand XML attribute order is not semantically meaningful according to the XML specification. However, deterministic output is still important for testing and reproducibility purposes.