Forum Discussion

星小梦's avatar
星小梦
Occasional Contributor
5 years ago

When the @Schema description request parameter type is Query, the description attribute content of t

When the @Schema description request parameter type is Query, the description attribute content of the @Schema annotation is not displayed

Among them, the ApiModelProperty annotation can be used normally, and the content of the description attribute of the @Schema annotation of the OpenAPI3 specification is not displayed at all

 

Below is the content displayed by swagger-ui, which is returned through the swagger interface, and there is no description with the description attribute.

 

 

  • Full context (project in use, version, full resource method, etc) is not clear from attached screenshots, but one problem for sure is that it seems you're mixing swagger 1.5 annotations with swagger 2.x ones. Assuming you are using swagger-core, depending if you're targeting Swagger/OpenAPI 2.0 or OpenAPI 3.0, you would need to use exclusively one or the other (so e.g. either `ApiModelProperty` or `Schema`)

  • Full context (project in use, version, full resource method, etc) is not clear from attached screenshots, but one problem for sure is that it seems you're mixing swagger 1.5 annotations with swagger 2.x ones. Assuming you are using swagger-core, depending if you're targeting Swagger/OpenAPI 2.0 or OpenAPI 3.0, you would need to use exclusively one or the other (so e.g. either `ApiModelProperty` or `Schema`)