You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a field called summary (or, alternatively, label or title) to the Tag Object.
This optional field would be used as the "human readable" representation of the tag name, in case it's provided.
Problem
When tags are used for grouping endpoints (documentation generators often use tags for this), the lack of a summary (or label) field causes problems.
For example, say that you have these grouped endpoints:
Manage Users
Create a user (POST)
Read a user (GET)
Manage Articles
Create an article (POST)
Read an article (GET)
Remove an article (DELETE)
You'd have to use the following tag data:
# CODE TODAY# roottags:
- name: User Managementdescription: Manage users via our API.
- name: Article Managementdescription: Manage articles via our API.# on each endpointoperationId: abctags: [User Management]summary: Create a user
In this case you'd rather set tags to [users] on each operation/endpoint, and use a global summary field for the tag, with the value User Management.
# DESIRED CODE# roottags:
- name: userssummary: User Managementdescription: Manage users via our API.
- name: articlessummary: Article Managementdescription: Manage articles via our API.# on each endpointoperationId: abctags: [users]summary: Create a user
Open Questions
What should the field be named? (summary, label, title, or something else?)
For reference, here are some Swagger documentation on this topic:
I would also be interested in this enhancement as well.
I currently consider tags as machine-readable because operations are machine-readable (and the referenced documentation page has the title "Grouping Operations With Tags"). For UI (generation), having something like a summary/label/title would help.
I've seen x-displayName used with tags in a few places. Also whether we add this for OpenAPI 3.x or not, I've also got a proposal open for richer tags in the next major release of OpenAPI - feel free to engage with that discussion also OAI/sig-moonwalk#67
Update: I wrote up a proposal to introduce the summary field for tags: #4063 - if you are following this issue, please go and check it does what you had in mind?
Suggested Enhancement
Add a field called
summary
(or, alternatively,label
ortitle
) to the Tag Object.This optional field would be used as the "human readable" representation of the tag
name
, in case it's provided.Problem
When tags are used for grouping endpoints (documentation generators often use tags for this), the lack of a summary (or label) field causes problems.
For example, say that you have these grouped endpoints:
You'd have to use the following tag data:
In this case you'd rather set tags to
[users]
on each operation/endpoint, and use a globalsummary
field for the tag, with the valueUser Management
.Open Questions
For reference, here are some Swagger documentation on this topic:
https://swagger.io/docs/specification/grouping-operations-with-tags/
The text was updated successfully, but these errors were encountered: