Custom sorting/position is not honored for V2
See original GitHub issueUsing an annotation such as:
@ApiOperation(
value = "Operation",
notes = "Notes",
position = 2
)
and a custom ordering such as:
docket.apiDescriptionOrdering(new Ordering<ApiDescription>() {
@Override
public int compare(ApiDescription left, ApiDescription right) {
int leftPos = left.getOperations().size() == 1 ? left.getOperations().get(0).getPosition() : 0;
int rightPos = right.getOperations().size() == 1 ? right.getOperations().get(0).getPosition() : 0;
int position = Integer.compare(leftPos, rightPos);
if(position == 0) {
position = left.getPath().compareTo(right.getPath());
}
return position;
}
});
The scanner framework seems to read the documentation and sort it properly. When the data is extracted to the Swagger object at Swagger2Controller.java:74, the ordering seems to be lost.
Issue Analytics
- State:
- Created 8 years ago
- Comments:26 (6 by maintainers)
Top Results From Across the Web
Custom Sorting option not working in Magetno 2.4 search
When i select the Newest filter it shows the message No Result Found. Any one tell me what is the issue or any...
Read more >Custom sorting function in javascript not working
I'm trying to write a custom sort function for my array of objects in javascript. For testing purposes, my arr array looks like...
Read more >Sort data using a custom list - Microsoft Support
From the Order drop-down, select Custom List. In the Custom Lists box, select the list that you want, and then click OK to...
Read more >legend custom sort not working - Microsoft Power BI Community
Solved: I have a line chart with legend field [FY Label], whose values are like '2018-2019', '2019-2020', 'Current FY'. This field is a...
Read more >Power BI Custom Sort Order with hidden columns - YouTube
This Power BI custom sort order tutorial shows a new method of creating custom sorting using hidden columns and NO JOINS!
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 Free
Top 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
So let me get this right… If your consumer has to follow a hateoas pattern: ie: Call1 must get a list of objects and returns Id to make call 2 Call2 must use id from Call1 to fetch an object that has a list of objects to fetch for Call3 by Id Call3 must use id from Call2 to retrieve last object
But somewhere, someone decided that Alphabetical was a good solution??? Umm… WHY? Now, I have to explain to all users of my swagger doc that they must start at 2, then goto 3 then goto 1 depending on how my endpoint is alphabetically arranged.
Pure and utter NONSENSE! FIX THIS!
I try new version 2.9.2,operationOrdering and apiListingReferenceOrdering not working!It’s a bug!