NSwag
NSwag copied to clipboard
How to include additional models in swagger.json?
Hello,
I have a public class that are is not exposed in my API so it is not included in swagger.json specification.
Is there a way to manually add a namespace/baseclass to swagger?
The following 'dummy' controller action allows me to have these custom classes in the swagger spec but I would like to ideally register a namespace and have all classes included automatically.
[HttpGet]
[SwaggerResponse(typeof(MyCustomClass1))]
[SwaggerResponse(typeof(MyCustomClass2))]
public IActionResult DummyAction()
{
return Ok();
}
Here is answer:
https://github.com/RicoSuter/NSwag/issues/3441#issuecomment-906494763
Close issue?