Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prataprc opened this issue Jun 30, 2017 · 1 comment
Open

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

prataprc opened this issue Jun 30, 2017 · 1 comment
Assignees

Comments

@prataprc
Copy link
Member

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

@prataprc prataprc self-assigned this Jun 30, 2017
@prataprc
Copy link
Member Author

prataprc commented Jul 2, 2017

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

@prataprc prataprc changed the title Sort map keys before converting from Value to Json. JSON: Sort map keys before converting from Value to Json. Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant