Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger documentation: Swashbuckle (hide methods/properties)

I am using Swagger Swashbuckle to generate documentation. There are some methods in my controller and some properties in my models that I don't want to document. Is there any arrtibute or the property to leave or ignore specific methods from documentation?

like image 496
Syed Uzair Uddin Avatar asked Oct 16 '25 03:10

Syed Uzair Uddin


1 Answers

In addition to c.IgnoreObsoleteActions(), there is also c.IgnoreObsoleteProperties(), which hides the property from the documentation.

JsonIgnoreAttribute will stop the property deserializing when being received as part of a POST request body, which may not be what you want if you only wish to change the documentation and not the functionality.

like image 149
zola25 Avatar answered Oct 19 '25 13:10

zola25