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

Introduce Summary Field on Tag Object #2843

Open
1 task
sandstrom opened this issue Jan 5, 2022 · 4 comments
Open
1 task

Introduce Summary Field on Tag Object #2843

sandstrom opened this issue Jan 5, 2022 · 4 comments
Assignees
Labels
metadata tags, info, license, contact, markdown usage, etc.
Milestone

Comments

@sandstrom
Copy link

sandstrom commented Jan 5, 2022

Suggested Enhancement

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

# root
tags:
  - name: User Management
    description: Manage users via our API.
  - name: Article Management
    description: Manage articles via our API.

# on each endpoint
  operationId: abc
  tags: [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

# root
tags:
  - name: users
    summary: User Management
    description: Manage users via our API.
  - name: articles
    summary: Article Management
    description: Manage articles via our API.

# on each endpoint
  operationId: abc
  tags: [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:

https://swagger.io/docs/specification/grouping-operations-with-tags/

@sandstrom
Copy link
Author

@MikeRalphson @webron @darrelmiller happy to hear your thoughts! Maybe I've missed something obvious, that makes this a bad idea.

@sandstrom sandstrom changed the title Introduce summary field on tag object Introduce Summary Field on Tag Object Jan 5, 2022
@basilfx
Copy link

basilfx commented Nov 9, 2022

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.

@handrews handrews added the metadata tags, info, license, contact, markdown usage, etc. label Jan 29, 2024
@lornajane
Copy link
Contributor

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

@handrews handrews added this to the v3.2.0 milestone Aug 18, 2024
@lornajane
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata tags, info, license, contact, markdown usage, etc.
Projects
None yet
Development

No branches or pull requests

4 participants