Skip to content
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

Support the use of multiple tags for operations #1776

Closed
steve-nay-sage opened this issue Sep 21, 2021 · 6 comments
Closed

Support the use of multiple tags for operations #1776

steve-nay-sage opened this issue Sep 21, 2021 · 6 comments
Labels

Comments

@steve-nay-sage
Copy link

User story.

As a technical writer, I'd like to be able to use multiple tags on operations to have them appear in more than one location in the documentation.

Is your feature request related to a problem?

Depends on what you consider a problem. Stoplight Elements currently ignores all but the first tag in a tags array. Some might think that's a problem.

Describe the solution you'd like

The tags property of an operation takes an array for a reason: to allow flexibility in how information is organized in the documentation. Here's a faked sample-- don't worry about any missing parts:

/pets
get:
summary: List pets
description: See all pets available for adoption.
tags:
- Pets
- Cats
- Dogs

That should result in left column navigation that looks something like this:

Cats
List pets
Dogs
List pets
Pets
List pets

The example would have more impact if there were other tags and operations mixed in there, but hopefully it conveys the idea.

@philsturgeon philsturgeon added enhancement New feature or request help wanted labels Oct 1, 2021
@philsturgeon
Copy link
Contributor

This is a good point. Stoplight has historically used the first tag only, and that may have been a specific requirement at some point, but I do wonder why. I can try and poke some people to find out, but I think this would be a good PR and if there's any conflict we can put it behind some sort of switch at least.

@TekExplorer
Copy link

Can, perhaps, multiple tags be used to have nested foldable routes?

@philsturgeon
Copy link
Contributor

philsturgeon commented Apr 26, 2022 via email

@TekExplorer
Copy link

yeah @philsturgeon, i found that a couple days ago. that's the best solution imo
-> #1390

@philsturgeon
Copy link
Contributor

Cool! I think we can close this one down, @steve-nay-sage perhaps you could subscribe to #1390 instead.

@fgabolde
Copy link

I'd like to point out that the related issue (introducing tag groups) doesn't solve all the use cases that people use multiple tags for. Sometimes even though we want to design clean APIs, the product requirements are weird, and it results in operations being related to two different concerns. Not Pets > Cats and Pets > Dogs, but more like Pets > Cats and Banking.

Other tools simply make the operation available in both of these tags, e.g. openapi-generator will create the investInCats method in both the Cats service and the Banking service.

Tag grouping can be a complement to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants