smallrye-open-api: Matrix parameter is not generated correctly

We have a couple of endpoints with matrix parameters.

One of them looks like this:

  public Response getChanged(
...
      @Parameter(required = false, description = "Filter für die zu berücksichtigenden Geschäftsstati: " +
          "Bei leerem Wert erfolgt keine Einschränkung")
      @MatrixParam("status") final List<String> status,
...
  }

(I have kept the original German description because of the JSON that follows later.)

With our original toolchain with Swagger annotations, I get:

    "/api/changed" : {
      "get" : {
...
        {
          "name" : "status",
          "in" : "path",
          "description" : "Filter für die zu berücksichtigenden Geschäftsstati: Bei leerem Wert erfolgt keine Einschränkung",
          "required" : true,
          "style" : "matrix",
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        },
...

Note that it’s generated as required, which is a bug in that Swagger Maven plugin.

In SwaggerUI, it looks like this and can be used:

old

With SmallRye, I get:

    "/api/changed{changed}" : {
      "get" : {
...
        {
          "name" : "changed",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "object",
            "properties" : {
              "status" : {
                "type" : "array",
                "items" : {
                  "type" : "string"
                }
              }
            }
          },
          "style" : "matrix",
          "explode" : true
        },
...

In SwaggerUI, it looks like this and can’t be used: new

I see several problems:

  • The parameter name is not taken from the code, but generated probably from the method name.
  • The parameter is shown as required, even though required = false.
  • The description of the parameter is ignored.
  • It doesn’t work, which is why I suggest that matrix parameters should be generated in the same way that the Swagger toolchain does it.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

Well, that’s what I see in SwaggerUI, yes. You’re right, in neither case are these matrix parameters.

We’re using JBoss EAP 7.4.18.GA (WildFly Core 15.0.37.Final-redhat-00001). And this is a JEE application, not Quarkus.