I\'m using Swashbuckle with ASP.net core. It is producing a nice website with a list of models at the bottom.
How can I add a model to this list that isn\'t al
In retrospect, the other answer that I found below (and on other pages) was better, namely to add this kind of attribute:
[HttpGet("")]
[ProducesResponseType(typeof(MyResult), (int)System.Net.HttpStatusCode.OK)]
[ProducesResponseType(typeof(ErrorBase), (int)System.Net.HttpStatusCode.NotFound)]
... function definition ...
Why: because the function gives different types of objects based on different situations and with these attributes you can specify which objects are returned in which situation.
For example I can give back
return Ok(myresult)
or
return NotFound(myerror)
in my function based on whether I've found a result or not.