swagger-api / swagger-api/swagger-codegen-generators

[jaxrs-di] Bean Validation not respected for body params

Open
#366 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

When generating APIs using the jaxrs-di library, bean validation annotations are not added to the generated API classes for body params:

    public Response createFoo(@Parameter(description = "" ) Foo body

,@Context SecurityContext securityContext)
    throws NotFoundException {
        return delegate.createFoo(body,securityContext);
    }

This results in the delegate receiving non-validated data.

Note that this may be more systemic in the jaxrs-di project, but I haven't gotten deep enough to check validation of non-body parameters yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the jaxrs-di generation path for the generated API class and its body-parameter handling, then compare the shown output with generated APIs for other parameter types. Done means body parameters carry the expected Bean Validation annotations and invalid body data is rejected before reaching the delegate.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.