Giter Site home page Giter Site logo

Comments (11)

Krieke avatar Krieke commented on August 17, 2024 1

+1

from play-swagger.

sloshy avatar sloshy commented on August 17, 2024

Just ran into this issue the other day. I would note that this tag also appears when you have a route in the main routes file but with another tag. For example, I have a tag "game" and if I have a route in my main routes file tagged "game", the "routes" tag also appears despite there being no routes with that tag, even if there are other includes in the routes file.

Instead, if I force all of my routes to be in an external routes file, the "routes" tag disappears. This is not a very convenient solution as I have to split my routes files even if I don't need them that way. A good solution might be checking if there are any untagged routes and, if there are none, removing the "routes" tag altogether.

from play-swagger.

xnejp03 avatar xnejp03 commented on August 17, 2024

yes please, remove the routes tag if there are no paths in it. All my paths are under different tags, and I have a couple of NoDocs routes, but the routes tag still shows, empty.

from play-swagger.

andrey-eyeem avatar andrey-eyeem commented on August 17, 2024

+1

from play-swagger.

Ard4nis avatar Ard4nis commented on August 17, 2024

Is there any eta on this being solved? I am currently still experiencing this issue which indeed is confusing.

from play-swagger.

kchaitanya1195 avatar kchaitanya1195 commented on August 17, 2024

Possible fix would be to remove this code here

generatedTagsJson adds a global level tag for every routes file processed. The same tag is already added to all routes in the file, so the global level tag is not required (and, imo, does not add any information to the doc). If users need to add description or other attribute, those can always be added in the base swagger file.

Removing this could fix the issue.

cc: @joprice , @kailuowang

from play-swagger.

kchaitanya1195 avatar kchaitanya1195 commented on August 17, 2024

Please take a look at this sample fix.

from play-swagger.

kailuowang avatar kailuowang commented on August 17, 2024

I think that is just an inventory of all the tags. I suspect that removing it might break all tags and not fix the root tag problem. Maybe you can write some test to try it out.

from play-swagger.

kchaitanya1195 avatar kchaitanya1195 commented on August 17, 2024

@kailuowang , As defined in swagger docs:
Note that it is possible to use a tag in an operation even if it is not defined on the root level.

The root tags object is for adding common attributes to a tag like description. The play swagger plugin adds a tag to all routes regardless of what's in the root tag object. Here's my test for the same.

from play-swagger.

kailuowang avatar kailuowang commented on August 17, 2024

Interesting. Would you open a PR?

from play-swagger.

kchaitanya1195 avatar kchaitanya1195 commented on August 17, 2024

@kailuowang Any updates on this?

from play-swagger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.