httpie changing the json fields order in the output
See original GitHub issueWondering how can I force httpie to not change the json fields order?
curl -i http://localhost:8080/v1/notes/569766aed4c661fba8d85a12
{
"id": "569766aed4c661fba8d85a12",
"content": "hi"
}
with httpie
http get :8080/v1/notes/569766aed4c661fba8d85a12
{
"content": "hi",
"id": "569766aed4c661fba8d85a12"
}
I prefer the id
field to be always the first. Any thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:27 (4 by maintainers)
Top Results From Across the Web
httpie changing the json fields order in the output #427 - GitHub
Wondering how can I force httpie to not change the json fields order? ... I prefer the id field to be always the...
Read more >JSON - HTTPie 3.2.1 (latest) docs
HTTPie does several things by default in order to make its terminal output easy to read. Colors and formatting. Syntax highlighting is applied...
Read more >How can we change the order of JSON Object using Java?
1. A JSON object is an unordered collection of name/value pairs. – Robby Cornelissen · You may not be able to do with...
Read more >httpie 0.3.0 - PyPI
Expressive and intuitive syntax. Formatted and colorized terminal output. Built-in JSON support. Forms and file uploads. HTTPS, proxies, and authentication.
Read more >Preserving JSON object keys order, in JavaScript, Python, and ...
The keys order problem of a JSON object. In above encoding example I've shown only the output from JavaScript code, there is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just lost way more time than I’m comfortable admitting trying to track down a problem in my server-side JSON library because I couldn’t work out why it was sending the data out in the wrong order. It didn’t even occur to me that the client could be reordering stuff.
Is it even worthwhile having the option to reorder JSON? 90% of the time it’s going to obfuscate rather than improve server output.
I’d submit a pull request, but it would just be changing a “True” to a “False” in one file. 😃(see below)Is there any traction on this issue? Like @carlfish, I have just spend an embarrassingly long amount of time trying to correct a bug in my server, only to find, that httpie was the issue.
It seems very unintuitive that it would reorder/sort data from the server, without the user explicitly enabling it.