Product Engineer, CTO & a Beer Enthusiast
Experiments, thoughts and scripts documented for posterity.
Mar, 2015
The whole notion of interface based development model is to separate the backend developers from frontend developers by exposing the operations and models. While models represent the entity fields and its properties like required status, max length and other validation characteristics etc, operations represents the restful endpoints or API operations for the client to consume.
public class ValuesController : ApiController
{
///
/// Gets the resource by the specified ID.
///
/// The id.
/// These remarks end up in the implementation notes of swagger
public string Get(string id)
{
return "value";
}
...
Basically upon compilation, a resource list file (json) is created for machine readability and swaggerUI provides a very neat API explorer and documentation interface for human readability similar to below.