Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit schema type specified on @Parameter annotation is always ignored #4763

Open
adriansuarez opened this issue Oct 23, 2024 · 0 comments

Comments

@adriansuarez
Copy link

adriansuarez commented Oct 23, 2024

I am accepting a query parameter within an object in an opaque form so that I can apply Jakarta validation constraints to it, rather than failing to create the object at all and generating a useless message about dependency injection not being able to build the object.

I'm declaring a query parameter as a String and then parsing it later, as follows:

    @PositiveOrZero
    @Parameter(description = "The offset at which to list items", schema = @Schema(type = "integer", format = "int32"))
    @QueryParam(OFFSET)
    public String offset;

Despite this, the schema for the query parameter continues to have string as its type:

      parameters:
      - name: offset
        in: query
        description: The offset at which to list items
        schema:
          type: string  # should be type: integer
          format: int32

Using schema = @Schema(implementation = Integer.class) also fails to attach the correct type to the query parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant