Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ namespace {{packageName}}.Controllers
{ {{#operations}}
/// <summary>
/// {{description}}
/// </summary>{{#description}}{{#basePath}}
[Route("{{{basePath}}}")]
{{/basePath}}[Description("{{description}}")]{{/description}}
/// </summary>{{#description}}
[Description("{{description}}")]{{/description}}
public class {{classname}}Controller : Controller
{ {{#operation}}

Expand All @@ -29,7 +28,7 @@ namespace {{packageName}}.Controllers
/// <param name="{{paramName}}">{{description}}</param>{{/allParams}}{{#responses}}
/// <response code="{{code}}">{{message}}</response>{{/responses}}
[{{httpMethod}}]
[Route("{{path}}")]
[Route("{{basePathWithoutHost}}{{path}}")]
[SwaggerOperation("{{operationId}}")]{{#returnType}}
[SwaggerResponse(200, type: typeof({{&returnType}}))]{{/returnType}}
public virtual {{#returnType}}IActionResult{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class PetApiController : Controller
/// <param name="body">Pet object that needs to be added to the store</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/pet")]
[Route("/v2/pet")]
[SwaggerOperation("AddPet")]
public virtual void AddPet([FromBody]Pet body)
{
Expand All @@ -64,7 +64,7 @@ public virtual void AddPet([FromBody]Pet body)
/// <param name="apiKey"></param>
/// <response code="400">Invalid pet value</response>
[HttpDelete]
[Route("/pet/{petId}")]
[Route("/v2/pet/{petId}")]
[SwaggerOperation("DeletePet")]
public virtual void DeletePet([FromRoute]long? petId, [FromHeader]string apiKey)
{
Expand All @@ -80,7 +80,7 @@ public virtual void DeletePet([FromRoute]long? petId, [FromHeader]string apiKey)
/// <response code="200">successful operation</response>
/// <response code="400">Invalid status value</response>
[HttpGet]
[Route("/pet/findByStatus")]
[Route("/v2/pet/findByStatus")]
[SwaggerOperation("FindPetsByStatus")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public virtual IActionResult FindPetsByStatus([FromQuery]List<string> status)
Expand All @@ -102,7 +102,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery]List<string> status)
/// <response code="200">successful operation</response>
/// <response code="400">Invalid tag value</response>
[HttpGet]
[Route("/pet/findByTags")]
[Route("/v2/pet/findByTags")]
[SwaggerOperation("FindPetsByTags")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public virtual IActionResult FindPetsByTags([FromQuery]List<string> tags)
Expand All @@ -125,7 +125,7 @@ public virtual IActionResult FindPetsByTags([FromQuery]List<string> tags)
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
[HttpGet]
[Route("/pet/{petId}")]
[Route("/v2/pet/{petId}")]
[SwaggerOperation("GetPetById")]
[SwaggerResponse(200, type: typeof(Pet))]
public virtual IActionResult GetPetById([FromRoute]long? petId)
Expand All @@ -148,7 +148,7 @@ public virtual IActionResult GetPetById([FromRoute]long? petId)
/// <response code="404">Pet not found</response>
/// <response code="405">Validation exception</response>
[HttpPut]
[Route("/pet")]
[Route("/v2/pet")]
[SwaggerOperation("UpdatePet")]
public virtual void UpdatePet([FromBody]Pet body)
{
Expand All @@ -165,7 +165,7 @@ public virtual void UpdatePet([FromBody]Pet body)
/// <param name="status">Updated status of the pet</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/pet/{petId}")]
[Route("/v2/pet/{petId}")]
[SwaggerOperation("UpdatePetWithForm")]
public virtual void UpdatePetWithForm([FromRoute]long? petId, [FromForm]string name, [FromForm]string status)
{
Expand All @@ -182,7 +182,7 @@ public virtual void UpdatePetWithForm([FromRoute]long? petId, [FromForm]string n
/// <param name="file">file to upload</param>
/// <response code="200">successful operation</response>
[HttpPost]
[Route("/pet/{petId}/uploadImage")]
[Route("/v2/pet/{petId}/uploadImage")]
[SwaggerOperation("UploadFile")]
[SwaggerResponse(200, type: typeof(ApiResponse))]
public virtual IActionResult UploadFile([FromRoute]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class StoreApiController : Controller
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpDelete]
[Route("/store/order/{orderId}")]
[Route("/v2/store/order/{orderId}")]
[SwaggerOperation("DeleteOrder")]
public virtual void DeleteOrder([FromRoute]string orderId)
{
Expand All @@ -63,7 +63,7 @@ public virtual void DeleteOrder([FromRoute]string orderId)
/// <remarks>Returns a map of status codes to quantities</remarks>
/// <response code="200">successful operation</response>
[HttpGet]
[Route("/store/inventory")]
[Route("/v2/store/inventory")]
[SwaggerOperation("GetInventory")]
[SwaggerResponse(200, type: typeof(Dictionary<string, int?>))]
public virtual IActionResult GetInventory()
Expand All @@ -86,7 +86,7 @@ public virtual IActionResult GetInventory()
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpGet]
[Route("/store/order/{orderId}")]
[Route("/v2/store/order/{orderId}")]
[SwaggerOperation("GetOrderById")]
[SwaggerResponse(200, type: typeof(Order))]
public virtual IActionResult GetOrderById([FromRoute]long? orderId)
Expand All @@ -108,7 +108,7 @@ public virtual IActionResult GetOrderById([FromRoute]long? orderId)
/// <response code="200">successful operation</response>
/// <response code="400">Invalid Order</response>
[HttpPost]
[Route("/store/order")]
[Route("/v2/store/order")]
[SwaggerOperation("PlaceOrder")]
[SwaggerResponse(200, type: typeof(Order))]
public virtual IActionResult PlaceOrder([FromBody]Order body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class UserApiController : Controller
/// <param name="body">Created user object</param>
/// <response code="0">successful operation</response>
[HttpPost]
[Route("/user")]
[Route("/v2/user")]
[SwaggerOperation("CreateUser")]
public virtual void CreateUser([FromBody]User body)
{
Expand All @@ -63,7 +63,7 @@ public virtual void CreateUser([FromBody]User body)
/// <param name="body">List of user object</param>
/// <response code="0">successful operation</response>
[HttpPost]
[Route("/user/createWithArray")]
[Route("/v2/user/createWithArray")]
[SwaggerOperation("CreateUsersWithArrayInput")]
public virtual void CreateUsersWithArrayInput([FromBody]List<User> body)
{
Expand All @@ -78,7 +78,7 @@ public virtual void CreateUsersWithArrayInput([FromBody]List<User> body)
/// <param name="body">List of user object</param>
/// <response code="0">successful operation</response>
[HttpPost]
[Route("/user/createWithList")]
[Route("/v2/user/createWithList")]
[SwaggerOperation("CreateUsersWithListInput")]
public virtual void CreateUsersWithListInput([FromBody]List<User> body)
{
Expand All @@ -94,7 +94,7 @@ public virtual void CreateUsersWithListInput([FromBody]List<User> body)
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpDelete]
[Route("/user/{username}")]
[Route("/v2/user/{username}")]
[SwaggerOperation("DeleteUser")]
public virtual void DeleteUser([FromRoute]string username)
{
Expand All @@ -111,7 +111,7 @@ public virtual void DeleteUser([FromRoute]string username)
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpGet]
[Route("/user/{username}")]
[Route("/v2/user/{username}")]
[SwaggerOperation("GetUserByName")]
[SwaggerResponse(200, type: typeof(User))]
public virtual IActionResult GetUserByName([FromRoute]string username)
Expand All @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute]string username)
/// <response code="200">successful operation</response>
/// <response code="400">Invalid username/password supplied</response>
[HttpGet]
[Route("/user/login")]
[Route("/v2/user/login")]
[SwaggerOperation("LoginUser")]
[SwaggerResponse(200, type: typeof(string))]
public virtual IActionResult LoginUser([FromQuery]string username, [FromQuery]string password)
Expand All @@ -154,7 +154,7 @@ public virtual IActionResult LoginUser([FromQuery]string username, [FromQuery]st
/// <remarks></remarks>
/// <response code="0">successful operation</response>
[HttpGet]
[Route("/user/logout")]
[Route("/v2/user/logout")]
[SwaggerOperation("LogoutUser")]
public virtual void LogoutUser()
{
Expand All @@ -171,7 +171,7 @@ public virtual void LogoutUser()
/// <response code="400">Invalid user supplied</response>
/// <response code="404">User not found</response>
[HttpPut]
[Route("/user/{username}")]
[Route("/v2/user/{username}")]
[SwaggerOperation("UpdateUser")]
public virtual void UpdateUser([FromRoute]string username, [FromBody]User body)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// Describes the result of uploading an image resource
/// </summary>
[DataContract]
public partial class ApiResponse : IEquatable<ApiResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// A category for a pet
/// </summary>
[DataContract]
public partial class Category : IEquatable<Category>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// An order for a pets from the pet store
/// </summary>
[DataContract]
public partial class Order : IEquatable<Order>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// A pet for sale in the pet store
/// </summary>
[DataContract]
public partial class Pet : IEquatable<Pet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// A tag for a pet
/// </summary>
[DataContract]
public partial class Tag : IEquatable<Tag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace IO.Swagger.Models
{
/// <summary>
///
/// A User who is purchasing from the pet store
/// </summary>
[DataContract]
public partial class User : IEquatable<User>
Expand Down