Skip to content

Feature: whole word filter option #6648

@MastersoftGroup

Description

@MastersoftGroup

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: Firefox mozilla
  • Version: 82.0.3
  • Method of installation: npm swagger-ui-dist
  • Swagger-UI version: 3.36.2
  • Swagger/OpenAPI version: Swagger 2.9.2

Content & configuration

Using SwaggerUIBundle with filter, which is using tags. I've noticed if I have a tag that the value contains in other tags (case-sensitive), e.g. tag "street" and tag "streetNumber", when I use filter: "street", it will display all operations for "street" tag as well as "streetNumber" tag. I want to only display operations for "street" tag.

Currently my workaround is adding an extra space: "street " tag, but this is not ideal because that means everytime we update or add new tags, we need to check all other tags to make sure no tag value contains other tag value.

To reproduce...

Steps to reproduce the behavior:

  1. Go to Rest Controller, create 2 methods, and add below @ApiOperation with tags on method1 and method2:
for method1: @ApiOperation(value = "Display street", tags = "street")
for method2: @ApiOperation(value = "Display street number", tags = "streetNumber")
  1. Get swagger-ui-dist and add SwaggerUIBundle with filter: "street" to a html page
  2. Scroll down to where you add to display the operations
  3. You will see both method1 ("street" tag) and method2 ("streetNumber") tag are displayed

Expected behavior

My expectation is only operations for that exact tag value will be displayed, e.g. using the above example, only method1 should be displayed, not both method1 and method2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions