Skip to content

Support labels or badges for paths(eg: user roles for which the API path works) and display them in the UI #3134

@chreniuc

Description

@chreniuc

I would like to be able to specify to each path some labels and make them visible in the UI. A usecase for this is to mark the paths for specific user roles from your API. Let me give you an example.

Let's say you want to group the paths by controller eg of tags to group them:

  • pet
  • store

Each having a lot of operations on them eg:

  • pet/update
  • pet/remove
  • store/update
  • store/filter
  • store/clear
  • etc...

I want to group them by controller(all pet and all store), that can be done with tags. But I also want to label some of those. for example I want to mark those operations that can be done by a specific user role .

For example only admins can call store/clear and receive a valid response, the rest of the users(normal users) can only call the other APIs. This way you can specify in the docs for what type of user are those paths, and this is only a use case, but I'm sure this can be used for other use cases.

I would like a way to add these labels and display them as in this image:

Can this be done? I tried to find something that already exists but couldn't find anything.

Here's someone from stackoverflow who asked something similar 3 years ago(I used their image): https://stackoverflow.com/questions/65422963/does-swashbuckle-support-a-way-to-represent-custom-operation-tags-as-badges-in-t

Activity

miqui

miqui commented on Jan 12, 2023

@miqui
Contributor

I use markdown and img.shields.io badges in the description for each resource. This does not seem to work on the summary attrib.

added
metadatatags, info, license, contact, markdown usage, etc.
on Jan 29, 2024
handrews

handrews commented on Sep 21, 2025

@handrews
Member

This has been addressed with the extended tags functionality in the newly-released OAS v3.2. The tags registry has already defined tag "kinds" for badges and audience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @handrews@miqui@chreniuc

        Issue actions

          Support labels or badges for paths(eg: user roles for which the API path works) and display them in the UI · Issue #3134 · OAI/OpenAPI-Specification