bnclabs/gson

JSON: Sort map keys before converting from Value to Json.

prataprc opened this issue · 1 comments

NewValue(map).ToJson(jsn).Bytes() should return JSON string with keys sorted.

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 :)