redoc icon indicating copy to clipboard operation
redoc copied to clipboard

http method class does not match when using x-displayName extension in Korean with sortTagsAlphabetically=true

Open Ellenwief opened this issue 2 years ago • 2 comments

Describe the bug adding korean to the x-displayName extension and setting the sortTagsAlphabetically option, the correct http method class is not reflected in the sorted results.

To Reproduce Steps to reproduce the behavior:

{
  "tags": [
    {
      "name": "User",
      "x-displayName": "사용자"
    },
    {
      "name": "DGroup",
      "x-displayName": "D그룹"
    },
  ],
 "paths": {
    "/users": {
      "get": {
        "tags": [
          "User"
        ],
      },
    },
    "/users": {
      "post": {
        "tags": [
          "User"
        ],
      },
    },
    "/groups": {
      "delete": {
        "tags": [
          "DGroup"
        ],
      },
    },
    "/groups": {
      "put": {
        "tags": [
          "DGroup"
        ],
      },
    }
  }
}

build-docs result get /users --> delete method class post /users --> put method class delete /groups --> get method class put /groups --> post method class

When the sortTagsAlphabetically option is given, it is initially sorted based on the Tag name and then re-sorted based on x-displayName. At this time, the class name initially given to the method class is fixed based on the Tag name, and when reordered by x-displayName, the color will not match the method name as the class name will remain in the original location.

Expected behavior

even if reordering occurs, a class that matches the method name must be assigned.

OpenAPI description

3.1

Redocly Version(s)

1.2.0

Ellenwief avatar Sep 22 '23 12:09 Ellenwief

Hi @Ellenwief,

Are you sure your example is valid? The paths section contains duplicated keys.

tatomyr avatar Sep 22 '23 14:09 tatomyr

I'm transferring the issue to Redoc project.

tatomyr avatar Sep 22 '23 14:09 tatomyr