Skip to content

Endpoints with double-asterisk in the path are excluded from the Swagger output #2895

Closed
@mc1arke

Description

@mc1arke

Describe the bug

Since 2.7.0, a path that contains a double asterisk do not get included in the Swagger output.

To Reproduce
Steps to reproduce the behaviour:

  1. Define an endpoint with a double asterisk in the path matching
@RestController
public class WildcardController {
    @PostMapping("/**")
    @Operation(summary = "My Wildcard Operation")
    public String getItem(HttpServletRequest request) {
        return request.getPathInfo();
    }
}
  1. Check the swagger output

Expected behaviour

The endpoint to be included in the swagger output, e.g.

{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "http://localhost",
      "description": "Generated server url"
    }
  ],
  "paths": {
    "/**": {
      "post": {
        "tags": [
          "wildcard-controller"
        ],
        "summary": "My Wildcard Operation",
        "operationId": "getItem",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {}
}

Additional context
1a9a1d4 appears to be the cause of this, which presumably was only supposed to filter out actuator endpoints that contained double asterisks, but is also filtering out non-actuator endpoints

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions