Skip to content

[BUG][JAVA][JAXRS] Query and path parameters are not validated  #3861

@Flugtiger

Description

@Flugtiger

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

The validation annotations are missing from path and query parameters. I.e. the code generated from the example below is missing the @NotNull annotation on the 'requiredParam'.

openapi-generator version

4.1.1

OpenAPI declaration file content or url
openapi: 3.0.2
info:
  title: missing validation annotations
  version: 1.0.0
paths:
  /test:
    post:
      parameters:
        - name: requiredParam
          in: query
          required: true
          schema:
            type: integer
      responses:
        202:
          description: a response
          content:
            'application/json':
              schema:
                type: object
Command line used for generation

-g jaxrs-jersey

Suggest a fix

include the beanValidation template in query and path parameter templates as well (not only in bodyParams)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions