Thanks Tony, I was able to see the improvements in this latest version.
It seems like there is a slight mismatch between how tags are implemented in swagger-core and how they are specified in the specification.
In the specification, tags (and their description, URL, etc) are defined at the root Swagger object level and then referenced (or not) by Operations across the different Paths. Additionally, the specification makes it clear that it is possible to use a tag in an Operation even if it is not defined at the root Swagger object level.
In swagger-core, tags are defined and referenced in the @Api annotation, which corresponds roughly to the Path object in the specification.
This carries the following implications:
- All Operations under that Path are tagged with that tag. So it is not possible to have only half of the Operations in a resource class tagged with a certain tag.
- It is not possible to tag Operations implemented in different resources with the same tag, because that would imply defining the same tag twice. I actually tried defining the same tag in different resources to see what would happen and one of the resources is simply not included in the resulting swagger file (presumably because of some error that occurs while building the Swagger model).
- Finally, it is not possible to tag a method with a tag that is not defined in the root Swagger definition.
To give a bit more context about the sort of thing we are evaluating Swagger for: we would like to build an Excel plugin that can read the API documentation for a service (in Swagger format), find all operations tagged with a special tag, for example "available-in-excel", and make those operations available as Excel function that calls the appropriate service when called, etc. This would require a finer control of which Operations are tagged. Something like this could also be achieved with the extension properties as well, but I don't think there's support from swagger-core for that yet.
Thanks,
James