Ask a Question

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

info2009pradeep
Regular Visitor

@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

cancel
Showing results for 
Search instead for 
Did you mean: