Commit 5adef5b
committed
docs: state that example key order is not significant
Two implementations asked independently whether the four languages should agree
on the key order within an example object. They currently do not: Java emits
Examples column order, Go sorts alphabetically because encoding/json sorts map
keys when marshalling, and neither is wrong.
A JSON object is unordered, so the answer is that order carries no meaning and
implementations need not agree. Saying so explicitly is worth a sentence, because
the alternative is three more implementations each deciding privately and someone
eventually byte-comparing two reports and concluding they disagree when they do
not.
If byte-level reproducibility is ever required -- an attestation over the
document is the obvious case -- that is a canonicalisation problem for the whole
report, not something to solve inside one field.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent ad22c19 commit 5adef5b
1 file changed
Lines changed: 3 additions & 1 deletion
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
0 commit comments