arcus-azure / arcus.templates

Collection of .NET templates & tooling to get started very easily.
https://templates.arcus-azure.net
MIT License
18 stars 12 forks source link

Include boilerplate code for supporting Swagger Examples #433

Closed fgheysels closed 3 years ago

fgheysels commented 3 years ago

When I create an API, I always provide custom examples for the request and/or response models of most API endpoints as this is more describing for the consumers of the API.

To be able to provide those examples, a little bit of boilerplate code is required. It would be nice if this could be provided by the WebApi template, as I always need to look up what exactly is required.
Next to that, providing such custom examples for the HealthController (which is created by the template), can also be an incentive for API developers to provide custom examples for the endpoints that they're writing.

For example: image

fgheysels commented 3 years ago

Note that providing a custom example for the GET endpoint of the HealthController also solves this issue: https://github.com/arcus-azure/arcus.templates/issues/424