Skip to content

URI as a schema implementation is resolving to null #3015

@paradoxcat

Description

@paradoxcat

When using annotations on our resource method the following Operation annotation will produce a null schema:

@Operation(responses = {
                    @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = URI.class))),
                    @ApiResponse(responseCode = "400", description = "Bad Request"),
                    @ApiResponse(responseCode = "500", description = "Internal Server Error")
            })
 "post" : {
        "operationId" : "exampleOperation",
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/null"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad Request"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        }
      }

I believe that "java.net.URI.class" is dealt with explicitly by "io.swagger.v3.core.util.PrimitiveType" and we are having similar issues with other classes mentioned there including "java.net.URL" and "java.util.UUID".

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