swagger-api / swagger-api/swagger-codegen

[JAVA] Spring MVC template missing initBinder

Open
#9,711 0 comments 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

In some case can be useful add initBinder in Spring mvc Controller

Swagger-codegen version

Latest

Swagger declaration file content or url

It is an improvement.

Command line used for generation

Generation with Spring MVC controller do not actually add this line

@InitBinder
public void initBinder(WebDataBinder binder) {
	delegate.initBinder(binder);
}

or 

@InitBinder
public void initBinder(WebDataBinder binder) {
	;
}
Steps to reproduce

In controller missing

Related issues/PRs

No related

Suggest a fix/enhancement

https://github.com/swagger-api/swagger-codegen/pull/9654

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 at the Spring MVC controller template and compare the generated controller with the proposed @InitBinder examples. Review pull request 9654 for the intended approach; done means generated controllers include the requested binder method and delegate behavior where applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.