JSON properties are shuffled
Hi,
I just execute this:
http http://localhost:9021/api/development
And i get this output:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Sun, 19 May 2024 10:58:34 GMT
Server: Kestrel
Transfer-Encoding: chunked
[
{
"allowedIps": null,
"configurationFile": "/tmp/proxies/ups1.conf",
"createdAt": "2024-05-18T18:13:44.204+00:00",
"id": "60ac07ef-5a80-4352-8b03-2ab8f68ef68f",
"password": "string",
"port": 1001,
"updatedAt": "2024-05-18T18:13:44.204+00:00",
"upstream": "ups1",
"username": "string"
}
]
I don't understand why properties are shuffled, should be like this:
[
{
"id": "60ac07ef-5a80-4352-8b03-2ab8f68ef68f",
"createdAt": "2024-05-18T18:13:44.204+00:00",
"updatedAt": "2024-05-18T18:13:44.204+00:00",
"upstream": "ups1",
"port": 1001,
"username": "string",
"password": "string",
"allowedIps": null,
"configurationFile": "/tmp/proxies/ups1.conf"
}
]
Regards
They are not shuffled, they are alphabetically sorted.
Ah I see, why touch it tho?
I don't know, just wrote thinking it might be helpful.
You can try --unsorted option, for more detail: https://httpie.io/docs/cli/format-options
As clarified in the thread, this is not an issue but clearly what was intended by the author. It was a UX decision and it is understandable how you got confused. Two sides emerge for this:
- A) Sorted render makes it easier to read by a human.
- B) Unsorted render makes it easier to verify the content conformity from the backend developer PoV.
But as you found the workaround for this, I am inclined to close it.