swagger-api / swagger-api/swagger-codegen

[JAVA]need `JsonIgnore` on java fluent setter

Open
#5,099 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java General: Suggestion help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Also want a configuration to diable java fluent setter.
Here is my problem:
I have a Schema Object which has a property like settlementNo then the generated class will have two
setter

 public ConditionRequest settlementNo(String settlementNo) {
    this.settlementNo = settlementNo;
    return this;
  }
  public void setSettlementNo(String settlementNo) {
    this.settlementNo = settlementNo

then with the default configuration of spring-fox and spring-boot , in the spring-fox-swagger-ui the ConditionRequest would have two property

settlementNo(the right one)

tlementNo(the wrong one)

And if both of the property has a value, tlementNo's will overwrite settlementNo's

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 locating the Java generator templates that produce fluent setters and compare their output with the conventional setter shown in the issue. The issue is addressed when the generated model no longer exposes the extra property in spring-fox-swagger-ui, or the requested configuration to disable fluent setters is available.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.