-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Using more than 8 tags breaks tag order #3022
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
Comments
Looking at past tickets related to sorting of tags (e.g. #1246) in the 2.x branch, I suspect that the bug causing this issue may in swagger-api/swagger-js. |
The ordering of the tags is actually not implemented at all yet in 3.x. |
If that's the case, then I retract my previous comment. "Sorting" in 3.x appears to be based on the order in which paths are defined and subsequently assigned to a tag. Using more than 8 tags disrupts that otherwise predictable order. In the example spec I provided above, the tags are rendered in the following order:
If I remove the "tag4" path object (for example), the order changes to:
There appears to be a certain logic to how this breaks and it's consistent. If I move the "tag8" path so it's the first path object, the order in which the tags are rendered is the same as the first example (where "pet" is sandwiched between "tag8" and "tag9"). |
Similar to the issue I logged where it also effects the properties in a model: |
@1Map it's actually different. See the comment I made in the other ticket. |
@webron I can't say I'm the world's greatest developer/programmer, but I have some programming background and would like to take a whack at fixing this. Would you be able to recommend a place to start in attempting to fix this/figuring out what is causing this issue? I'm having a hard time figuring out how the JSON/YAML definition file is being parsed, the HTML generated, and how that is taking place (e.g. hash maps or something else?). Any help you can give would be greatly appreciated. |
@realchrisolin As a workaround for now, I have a basic "sort all API tags by alpha" here. It's a very small change and I didn't implement the configurable apiSorter option nor is there any choice that isn't alpha nor does it sort APIs without tags I don't think. I can't tell if the comments in #2990 indicate that |
@realchrisolin another workaround - This one actually displays in the same order that is in the "tags" array, adding any additional tags (that were not declared) afterwards here |
I just pulled from master, built the Dockerfile and ran the image, but it is not working as @kogalex described. Do i need to configure something in the Dockerfile? |
@thales-gaddini, did you build your own Docker image, or use our Docker registry image? Our image gets updated each time the npm package does. To start, you can open the UI, go to your devtools console, and check the value of If you're having more trouble with this, please open a new ticket so we can keep the noise down for everyone else in this thread. |
It was my bad, sorry. I build my own Docker image in master, but from a different tag. Thank you for your time. I'll open a new ticket next time. |
Parsing a spec file with greater than eight (8) tags results in the tag order no longer being sorted alphabetically. Removing all of the paths associated with a tag so the total number of tags in use are less than 9 will fix this issue. This can be easily replicated in editor.swagger.io.
The text was updated successfully, but these errors were encountered: