Forum Discussion

info2009pradeep's avatar
info2009pradeep
Regular Visitor
3 years ago

@ApiModelProperty is not displaying the description for the model class field of type Object

In my springboot application, I have enabled swagger documentation. In the model classes, I have used @ApiModelProperty annotation to describe the fields. The swagger ui is displaying the description for primitive and string types but it is not displaying the description for object types.

 

For example,

public class MyModel{

@JsonProperty("data")
private String data;

@JsonProperty("flag")
private boolean flag;

@JsonProperty("person")
private Person person;

@ApiModelProperty(value="This is data")
public String getData(){
this.data=data;
return data;
}

@ApiModelProperty(value="This is falg")
public Boolean getFlag(){
this.flag=flag;
return flag;
}    

@ApiModelProperty(value="This is person data)
public Person getPerson(){
this.person=person;
return person;

//setters
}



 

This is the model class, the swagger ui(http://localhost:8080/swagger-ui.html) is displaying the description for
the fields 'data' and 'flag' but not displaying for the 'person' field description which is of type Object.
Could you please help me on this

No RepliesBe the first to reply