in my project I am using Swagger to document REST API. I have simple value object which I want to document.
public class MyClass {
@JsonValue
private String myField;
public String getMyField() {
return myField;
}
}
Unfortunately, when I am adding swagger annotations and then see created documentation, there is no information about this VO. Class with swagger annotations below:
@ApiModel(value = "MyClass ", description = "represents my class")
public class MyClass {
@JsonValue
@ApiModelProperty(value = "name", dataType = "String", example = "my field")
private String myField;
public String getMyField() {
return myField;
}
}
Wanted to check this issue I temporally removed @JsonValue annotation and documentation was created properly, annotation @ApiModelProperty worked.
I cannot remove @JsonValue annotation permanently.
Does anybody know the solution how can I force those two tools to cooperate?