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

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

    Issue actions