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

The name attribute of the annotation @ApiModelProperty does not take effect

Open huayangMr opened this issue 3 years ago • 2 comments

When the second letter of the attribute name of my entity class is capitalized, swagger will interpret my letter as lowercase. At this time, I use the name attribute of @ApiModelProperty to solve the problem. It is found that it does not take effect. I hope to use the name attribute value to overwrite the original attribute value after JSON serialization, otherwise name does not play its due role, but will cause misunderstanding, I think this is a problem; I can understand if only the first letter is capitalized, but the second letter needs to be capitalized in many business scenarios

huayangMr avatar Jan 12 '22 03:01 huayangMr

It seems to be working fine with Swagger 2 where @ApiModelProperty has been replaced by @Schema. I actually didn't need to set the name using the @Schema annotation as the generated openapi.json keeps the name of the class (entity) as is.

gcatanese avatar Apr 10 '22 16:04 gcatanese

It seems to be working fine with Swagger 2 where @ApiModelProperty has been replaced by @Schema. I actually didn't need to set the name using the @Schema annotation as the generated openapi.json keeps the name of the class (entity) as is.

you say @ApiModelProperty does not work in Swagger 3.0? I found it works

michaelwangwangwang avatar May 05 '22 02:05 michaelwangwangwang