question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ResponseHeaders appear in reverse alphabetical order. How do I sort them alphabetically?

See original GitHub issue

Here is the @ApiResponses annotation I currently have:

@ApiResponses(
        value = {
                @ApiResponse(code = 200, message = "OK", responseContainer = "List",
                        responseHeaders = {
                            @ResponseHeader(name = "aX-RateLimit-Reset", description = "The time, in seconds, until the limit expires and another request will be allowed in. This header will only be present if the limit is being enforced.", response = Integer.class),
                            @ResponseHeader(name = "zX-RateLimit-Remaining", description = "The number of calls remaining before the limit is enforced and requests are bounced.", response = Integer.class),
                            @ResponseHeader(name = "dX-RateLimit-zLimit", description = "The defined maximum number of requests available to the consumer for this API.", response = Integer.class)

                        }
                ),
                @ApiResponse(code = 400, message = "Bad Request"),
                @ApiResponse(code = 404, message = "Not Found"),
                @ApiResponse(code = 415, message = "Unsupported Media Type"),
                @ApiResponse(code = 500, message = "Internal Server Error"),
                @ApiResponse(code = 503, message = "Service Unavailable"),
                @ApiResponse(code = 504, message = "Gateway Timeout"),
                @ApiResponse(code = 505, message = "HTTP Version Not Supported")
        }
)

These response headers end up being shown in reverse alphabetical order in the ui, as seen here:

How do I get these to sort alphabetically? I originally assumed that it would be in the order that the responseHeaders list is in, but that doesn’t seem to be the case.

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fehguycommented, Dec 22, 2016

OK great, then you’ve got the ticket in the right place. I’ll check into this, it should retain the order inserted as we’re using LinkedHashMap

0reactions
ahatzz11commented, Jan 3, 2017

@fehguy Any ideas on the odd examples above?

Read more comments on GitHub >

github_iconTop Results From Across the Web

dplyr arrange by reverse alphabetical order [duplicate]
I'm curious why the arrange function won't will work for alphabetical order but not reverse alphabetical order.
Read more >
Windows explorer sorting in REVERSE alphabetical order.
It correctly places files before folders when I sort by NAME>Descending, but the file and folder names are in reverse alphabetical order.
Read more >
sort strings alphabetically python Code Example - Code Grepper
the_list.sort() # sorts normally by alphabetical order. 2. the_list.sort(key=len, reverse=True) # sorts by descending length. Source: stackoverflow.com ...
Read more >
Order Column Headers in reverse alphabetical order...
So, I can't use a table command. The chart command orders in the opposite direction since it does a default sort alphabetically.
Read more >
Common Query Parameters | Apache Solr Reference Guide 7.6
Sorts by the contents of the inStock field in descending order, then when multiple documents have the same value for the inStock field,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found