Open prataprc opened 7 years ago
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 :)
NewValue(map).ToJson(jsn).Bytes() should return JSON string with keys sorted.