swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

@Schema not working for boolean fields in Java

Open agilehorse opened this issue 3 years ago • 6 comments

Hello, I have these fields in Java object image however, when i look at generated apidocs, the additional information is missing image

When i change them to Boolean object, it starts working.

agilehorse avatar Dec 06 '21 10:12 agilehorse

Which version? On 2.2.0-SNAPSHOT it seems to be working fine

gcatanese avatar Mar 28 '22 07:03 gcatanese

See unit test in PR #4152

gcatanese avatar Mar 28 '22 09:03 gcatanese

I'm using springdoc openapi version 1.6.6

agilehorse avatar Mar 28 '22 10:03 agilehorse

@gcatanese I think that @agilehorse problem is the field name with prefix "is". I have the same issue in Kotlin.

wangchengyu avatar May 07 '22 02:05 wangchengyu

I have the same issue swagger-core 2.2.9

ZuevKirill95 avatar Nov 02 '23 05:11 ZuevKirill95

@ZuevKirill95 @agilehorse About this issue, the chatGPT give the solution is:

@ApiModelProperty(name = "isExample")
private boolean example;

or

@JsonProperty("isExample")
private boolean example;

wangchengyu avatar Nov 29 '23 09:11 wangchengyu