swagger-api / swagger-api/swagger-codegen

Provide support for JSR-303 annotations to validate the request body

Open
#4,847 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature help wanted Server: Spring
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Thank you for adding bean validation support in #4600. It would be great if you also could validate the Body parameter. Maybe you can apply the attached patch?

Swagger-codegen version

I'm using the swagger-codegen in version 2.2.2-SNAPSHOT.

Swagger declaration file content or url

see attached patch

Related issues

#4600
#2412

Suggest a Fix

see attached patch

Trigger_validation_process_for_request_body_by_using_Valid_annotation.patch.zip

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

Review #4600 and the attached validation patch first, then trace how swagger-codegen templates emit request-body parameters. Confirm the expected behavior against the related issues #4600 and #2412. Done means generated server stubs apply the requested JSR-303 validation to request bodies.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.