Skip to content

Introduce Summary Field on Tag ObjectΒ #2843

@sandstrom

Description

@sandstrom

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/

Metadata

Metadata

Assignees

Labels

metadatatags, info, license, contact, markdown usage, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions