Serialization: friendly or unfriendly properties?
IBM coined the term "unfriendly" for serializations that use repeated constant property names, and "friendly" where property names directly identify the property. For example, an unfriendly email header would be:
"header": [
{"header_name": "from", "value": "[email protected]"},
{"header_name": "to", "value", "[email protected]"}
]
The friendly alternative uses names to directly identify values:
"header": {
"from": "[email protected]",
"to": "[email protected]"
}
In SPDX this affects the serialization of types such as Hash ("algorithm", "hashValue") and NamespaceMap ("prefix", "namespace"). The logical model is unaffected; this issue concerns only serialization.
The unfriendly serialization of NamespaceMap is:
"namespace": [
{"prefix": "acme", "namespace": "http://sboms.acme.org"}
]
and the friendly version is:
"namespace": {
"acme": "http://sboms.acme.org"
}
Proposal: where repeated constant property names appear in lists of the form {"tag": x, "value": y} pairs, serialize them as object properties {x: y}.
Decision: ?
This needs to be sorted for 3.0
To be considered as part of any simple JSON proposal. Moving to 3.1