JSON: Sort map keys before converting from Value to Json.
prataprc opened this issue · 1 comments
prataprc commented
NewValue(map).ToJson(jsn).Bytes() should return JSON string with keys sorted.
prataprc commented
JSON is also exposed to users via API. This means JSON Properties may not have its keys sorted.
Would be a good feature to implement:
-
JSON->JSON with property keys sorted.
-
JSON->CBOR with property keys sorted.
-
For Values, JSON property is stored as map[string]interface{}, so no point is sorting it before converting to Value.
-
For Collate, JSON properties are already sorted :)