Ask a Question

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

SOLVED
星小梦
Occasional Contributor

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

星小梦_0-1602566291849.png

星小梦_1-1602566306354.png

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.

 

星小梦_0-1602566662290.png

 

1 REPLY 1
frantuma
Staff

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`)

cancel
Showing results for 
Search instead for 
Did you mean: