http4s/rho

Simple or-path produces incorrect tags

Closed this issue · 1 comments

Hi,

When using simple or-path:

GET / ("foo" || "bar") |>> { () => "Hello!" }

following swagger.json is produced:

{
  "paths": {
    "/foo": {
      "get": {
        "tags": [
          "foo",
          "bar"
        ],
        "operationId": "getFoo",
        "produces": [
          "text/plain"
        ]
      }
    },
    "/bar": {
      "get": {
        "tags": [
          "foo",
          "bar"
        ],
        "operationId": "getBar",
        "produces": [
          "text/plain"
        ]
      }
    }
  }
}

/foo path gets bar tag and /bar path gets foo tag which leads to unnecessary entries in swagger ui:

image

I would expect single tags on both routes.

Also if you specify tag yourself:

"mytag" @@ GET / ("foo" || "bar") |>> { () => "Hello!" }

it ends up there twice:

{
  "/foo": {
    "get": {
      "tags": [
        "mytag",
        "mytag"
      ],
      "operationId": "getFoo",
      "produces": [
        "text/plain"
      ]
    }
  }
}