Skip to content

sort JSONView keys alphabetically#525

Merged
bgentry merged 1 commit intomasterfrom
bg/fix-json-viewer-key-ordering
Mar 2, 2026
Merged

sort JSONView keys alphabetically#525
bgentry merged 1 commit intomasterfrom
bg/fix-json-viewer-key-ordering

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Mar 2, 2026

JSON viewer output could vary based on object key order from incoming payloads, which made payloads harder to scan and compare across views and copy/paste workflows. This change makes rendered and copied JSON output deterministic by sorting object keys consistently.

@bgentry bgentry requested a review from brandur March 2, 2026 15:10
JSON viewer output could vary based on object key order from incoming
payloads, which made payloads harder to scan and compare across views
and copy/paste workflows. This change makes rendered and copied JSON
output deterministic by sorting object keys consistently.
@bgentry bgentry force-pushed the bg/fix-json-viewer-key-ordering branch from 9896b97 to 6419df9 Compare March 2, 2026 15:10
@bgentry
Copy link
Contributor Author

bgentry commented Mar 2, 2026

I'm not 100% sure this is the "correct" thing to do, like you could definitely argue for sorting at an earlier point and/or preserving the order of the actual JSON. At least with metadata though I've been getting some pretty weird displays without this so it seems best to just sort client side. I feel less strongly about args.

Copy link
Collaborator

@brandur brandur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@bgentry bgentry merged commit d8bf160 into master Mar 2, 2026
21 checks passed
@bgentry bgentry deleted the bg/fix-json-viewer-key-ordering branch March 2, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants