Closed LingLong closed 9 years ago
Which version of swagger-core do you use?
What do you mean by 'show me these classes together'?
SwaggerUI has controls the ordering of the operations based on the sorter
parameter described here - https://github.com/swagger-api/swagger-ui#parameters.
I use version 1.3.12 What i meant was, that the apidoc-entries should appear in order, odered by thair paths. So, if /simulations appears in apidoc the next entry to should be /simulations/{simulationid}.
Then just set the sorter for SwaggerUi.
I just took a look at the sorter parameter. The last question is: are there other values for sorter then 'alpha' or 'method' to pass in ?
I think it can accept a sorting function as well.
Ok, thank you for your help!
I hope it is possible to open this issue again, because sorter only seems to sort annotated methods. But I like to sort resources. Better question is how could I tell swagger-ui that a resource is child of another resource?
There's no hierarchy for operations. There's only grouping, and within those groups you can sort the operations. That's pretty much it.
Coud you please show me an example of Grouping?
I just red swagger-spec:
Resource: A resource in Swagger is an entity that has a set of exposed operations. The entity can represent an actual object (pets, users..) or a set of logical operations collated together. It is up to the specification user to decide whether sub-resources should be referred to as part of their main resource or as a resource of their own. For example, assume the following URL set:
URL: A fully qualified URL.
But I do not understand the goal of this article. How to reffere sub-resource as part of a main-resource?
there's an example here:
Note how some operations appear under each "tag", which is clients
or servers
. The code is here:
If you look at the operation path /download/{fileId}
, you'll see that it's assigned to two tags. This is how you control where operations appear in the UI.
ok, i also found another solution for myself, maybe its a bit dirty. i only added the following line of code in swagger-client.js between lines 1838-1844: response.apis.sort(function(a,b) { return a.path.localeCompare(b.path) } );
this will sort response.apis in the right order
Thank you really much for your help.
I implemented swagger-ui like this:
everything works fine, i also annotated some classes like this:
The "problem " is that swagger-ui is showing me the following:
Now I want swagger-ui to show me these classes together in same order, because they are following the same path. Is there any way to do this?
Thanks for your help!