Skip to content

@JsonProperty not being set on model setters. Same as upstream https://github.com/OpenAPITools/openapi-generator/issues/6856Β #1351

@ameerabdallah

Description

@ameerabdallah

Tell us the extension you're using

Client

I tried this:

Ran the generator against a schema with some fields that are snake-cased. @JsonProperty is defined for the getter but not on the setter making deserialization not work properly. Found this PR from what I am understanding is the upstream of this repo: OpenAPITools/openapi-generator#6856

Appears to be fixed on there. Not familiar with this code base but can those changes be pulled in at all?

This happened:

    /**
    * Get seriesId
    * @return seriesId
    **/
    @JsonProperty("series_id")
    @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
    public Integer getSeriesId() {
        return seriesId;
    }

    /**
     * Set seriesId
     **/
    public void setSeriesId(Integer seriesId) {
        this.seriesId = seriesId;
    }

I expected this:

    /**
    * Get seriesId
    * @return seriesId
    **/
    @JsonProperty("series_id")
    @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
    public Integer getSeriesId() {
        return seriesId;
    }

    /**
     * Set seriesId
     **/
    @JsonProperty("series_id")
    public void setSeriesId(Integer seriesId) {
        this.seriesId = seriesId;
    }

Is there a workaround?

No response

How can we try to reproduce the issue?

No response

Anything else?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus OpenApi version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Community Notes

  • Please vote by adding a πŸ‘ reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.name: Bug Report 🐞

Metadata

Metadata

Assignees

Labels

area:clientThis item is related to the client extensiongood first issueGood for newcomershelp wantedExtra attention is needed

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions