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 properties are shuffled #1577

Closed
imclint21 opened this issue May 19, 2024 · 5 comments
Closed

JSON properties are shuffled #1577

imclint21 opened this issue May 19, 2024 · 5 comments
Labels
bug Something isn't working new Needs triage. Comments are welcome!

Comments

@imclint21
Copy link

imclint21 commented May 19, 2024

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

@imclint21 imclint21 added bug Something isn't working new Needs triage. Comments are welcome! labels May 19, 2024
@onlined
Copy link

onlined commented May 19, 2024

They are not shuffled, they are alphabetically sorted.

@imclint21
Copy link
Author

Ah I see, why touch it tho?

@onlined
Copy link

onlined commented May 21, 2024

I don't know, just wrote thinking it might be helpful.

@onlined
Copy link

onlined commented May 21, 2024

You can try --unsorted option, for more detail: https://httpie.io/docs/cli/format-options

@Ousret
Copy link
Collaborator

Ousret commented May 23, 2024

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.

@Ousret Ousret closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Needs triage. Comments are welcome!
Projects
None yet
Development

No branches or pull requests

3 participants