My model looks like this:
@AllArgsConstructor
@Data
@NoArgsConstructor
@Schema(description = "Contains list of strings")
public class MyResponse {
@Schema(requiredMode = RequiredMode.REQUIRED, description = "List of my sample strings")
@JsonProperty(required = true)
@NotNull
private List<String> myMessages;
}
Now, when I see my swagger ui, it looks like this:
Why is it printing myMessages twice? Shouldn't it just print once? I am using springdoc openapi ui 1.7.0
You can configure the description only for Array by using @ArraySchema annotation. Here is a simple example:
You can find the same question in this springdoc issue. https://github.com/springdoc/springdoc-openapi/issues/330