swagger-api / swagger-api/swagger-codegen

[Spring] Add hibernate validator annotations

Open
#7,152 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Spring server generator should add hibernate.validator annotations like org.hibernate.validator.constraints.Email to generated model class fields.

For Spring the Hibernate Validator is included in spring-boot-starter-web dependencies and there is no reason not to use it. Could add the feature to other Java generators too.

Swagger-codegen version

2.3.0-SNAPSHOT

Swagger declaration file content

email:
type: string
format: "email"

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

The issue names the Spring server generator and generated model class fields, with an email format example; start by locating the Spring generator's model templates and format handling. Done means generated email fields include the requested Hibernate Validator annotation, with coverage for the resulting model output and consideration of the other Java generators mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Feature
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.