Skip to content

@JsonProperty("newName") is not respected on fields #486

@shuz

Description

@shuz
public class User {

    @JsonProperty("userId")
    private Integer id;

    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }
    ...
}

The field is not renamed in the swagger doc.

In com/wordnik/swagger/converter/ModelPropertyParser.scala

    try {
      val fieldAnnotations = getDeclaredField(this.cls, name).getAnnotations()
      var propAnnoOutput = processAnnotations(name, fieldAnnotations)
      var propPosition = propAnnoOutput("position").asInstanceOf[Int]

The propAnnoOutput from the field is not used to update the name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions