0

I have been working with open api ui 3.0.0 and when I give annotations on API endpoints the APIs are shown on swagger endpoint. But interestingly there is a list of schemas that shows DTOs used in the endpoints. I need to remove those endpoints. So I tried setting content = @Content(schema = @Schema(hidden = true) on @ApiResponse.

It seems that the models used in endpoints annotated with these annotations are not shown except for endpoints where a DTO is used in request structure that is shown no matter what and the problem with others is that the response content seems to be shown empty with just response code and descritpion.

Is there any proper way of doing this in spring boot. Most of the standard API documentations doesn't shows this schemas and some of the DTOs are even something that I don't want to show the consumers of swagger documentation.

pacman
  • 725
  • 1
  • 9
  • 28
  • 1
    Try setting [`springdoc.swagger-ui.defaultModelsExpandDepth`](https://springdoc.org/properties.html#_swagger_ui_properties) (Model**s** not Model) to -1. – Helen Jul 26 '21 at 08:34

1 Answers1

0

Try use to one in the Docket, it works!

Dockek()...
.ignoredParameterTypes(ModleName.class)
W Kenny
  • 1,855
  • 22
  • 33