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 @@ -33,11 +33,21 @@ namespace {{packageName}}.Controllers
[ValidateModelState]
[SwaggerOperation("{{operationId}}")]{{#responses}}{{#returnType}}
[SwaggerResponse({{code}}, typeof({{&returnType}}), "{{message}}")]{{/returnType}}{{/responses}}
public virtual {{#returnType}}IActionResult{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{ {{#returnType}}
public virtual IActionResult {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{ {{#responses}}
{{#dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode({{code}}, default({{&dataType}}));
{{/dataType}}
{{^dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode({{code}});
{{/dataType}}{{/responses}}
{{#returnType}}
string exampleJson = null;
{{#isListCollection}}{{>listReturn}}{{/isListCollection}}{{^isListCollection}}{{#isMapContainer}}{{>mapReturn}}{{/isMapContainer}}{{^isMapContainer}}{{>objectReturn}}{{/isMapContainer}}{{/isListCollection}}
{{!TODO: defaultResponse, examples, auth, consumes, produces, nickname, externalDocs, imports, security}}
//TODO: Change the data returned
return new ObjectResult(example);{{/returnType}}{{^returnType}}
throw new NotImplementedException();{{/returnType}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,39 @@ public class PetApiController : Controller
/// <summary>
/// Add a new pet to the store
/// </summary>
/// <remarks></remarks>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not part of my updates.. note sure why this is changing...

/// <param name="body">Pet object that needs to be added to the store</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/v2/pet")]
[ValidateModelState]
[SwaggerOperation("AddPet")]
public virtual void AddPet([FromBody]Pet body)
public virtual IActionResult AddPet([FromBody]Pet body)
{
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(405);


throw new NotImplementedException();
}

/// <summary>
/// Deletes a pet
/// </summary>
/// <remarks></remarks>

/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"></param>
/// <response code="400">Invalid pet value</response>
[HttpDelete]
[Route("/v2/pet/{petId}")]
[ValidateModelState]
[SwaggerOperation("DeletePet")]
public virtual void DeletePet([FromRoute]long? petId, [FromHeader]string apiKey)
public virtual IActionResult DeletePet([FromRoute]long? petId, [FromHeader]string apiKey)
{
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);


throw new NotImplementedException();
}

Expand All @@ -76,11 +84,18 @@ public virtual void DeletePet([FromRoute]long? petId, [FromHeader]string apiKey)
[SwaggerResponse(400, typeof(List<Pet>), "Invalid status value")]
public virtual IActionResult FindPetsByStatus([FromQuery]List<string> status)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<Pet>));

//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
//TODO: Change the data returned
return new ObjectResult(example);
}

Expand All @@ -99,11 +114,18 @@ public virtual IActionResult FindPetsByStatus([FromQuery]List<string> status)
[SwaggerResponse(400, typeof(List<Pet>), "Invalid tag value")]
public virtual IActionResult FindPetsByTags([FromQuery]List<string> tags)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<Pet>));

//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
//TODO: Change the data returned
return new ObjectResult(example);
}

Expand All @@ -124,18 +146,28 @@ public virtual IActionResult FindPetsByTags([FromQuery]List<string> tags)
[SwaggerResponse(404, typeof(Pet), "Pet not found")]
public virtual IActionResult GetPetById([FromRoute]long? petId)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(Pet));

//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<Pet>(exampleJson)
: default(Pet);
//TODO: Change the data returned
return new ObjectResult(example);
}

/// <summary>
/// Update an existing pet
/// </summary>
/// <remarks></remarks>

/// <param name="body">Pet object that needs to be added to the store</param>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
Expand All @@ -144,15 +176,25 @@ public virtual IActionResult GetPetById([FromRoute]long? petId)
[Route("/v2/pet")]
[ValidateModelState]
[SwaggerOperation("UpdatePet")]
public virtual void UpdatePet([FromBody]Pet body)
public virtual IActionResult UpdatePet([FromBody]Pet body)
{
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);

//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(405);


throw new NotImplementedException();
}

/// <summary>
/// Updates a pet in the store with form data
/// </summary>
/// <remarks></remarks>

/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
Expand All @@ -161,15 +203,19 @@ public virtual void UpdatePet([FromBody]Pet body)
[Route("/v2/pet/{petId}")]
[ValidateModelState]
[SwaggerOperation("UpdatePetWithForm")]
public virtual void UpdatePetWithForm([FromRoute]long? petId, [FromForm]string name, [FromForm]string status)
public virtual IActionResult UpdatePetWithForm([FromRoute]long? petId, [FromForm]string name, [FromForm]string status)
{
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(405);


throw new NotImplementedException();
}

/// <summary>
/// uploads an image
/// </summary>
/// <remarks></remarks>

/// <param name="petId">ID of pet to update</param>
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
Expand All @@ -181,11 +227,15 @@ public virtual void UpdatePetWithForm([FromRoute]long? petId, [FromForm]string n
[SwaggerResponse(200, typeof(ApiResponse), "successful operation")]
public virtual IActionResult UploadFile([FromRoute]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(ApiResponse));

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<ApiResponse>(exampleJson)
: default(ApiResponse);
//TODO: Change the data returned
return new ObjectResult(example);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ public class StoreApiController : Controller
[Route("/v2/store/order/{orderId}")]
[ValidateModelState]
[SwaggerOperation("DeleteOrder")]
public virtual void DeleteOrder([FromRoute]string orderId)
public virtual IActionResult DeleteOrder([FromRoute]string orderId)
{
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);


throw new NotImplementedException();
}

Expand All @@ -58,11 +65,15 @@ public virtual void DeleteOrder([FromRoute]string orderId)
[SwaggerResponse(200, typeof(Dictionary<string, int?>), "successful operation")]
public virtual IActionResult GetInventory()
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(Dictionary<string, int?>));

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<Dictionary<string, int?>>(exampleJson)
: default(Dictionary<string, int?>);
//TODO: Change the data returned
return new ObjectResult(example);
}

Expand All @@ -83,18 +94,28 @@ public virtual IActionResult GetInventory()
[SwaggerResponse(404, typeof(Order), "Order not found")]
public virtual IActionResult GetOrderById([FromRoute]long? orderId)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(Order));

//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<Order>(exampleJson)
: default(Order);
//TODO: Change the data returned
return new ObjectResult(example);
}

/// <summary>
/// Place an order for a pet
/// </summary>
/// <remarks></remarks>

/// <param name="body">order placed for purchasing the pet</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid Order</response>
Expand All @@ -106,11 +127,18 @@ public virtual IActionResult GetOrderById([FromRoute]long? orderId)
[SwaggerResponse(400, typeof(Order), "Invalid Order")]
public virtual IActionResult PlaceOrder([FromBody]Order body)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(Order));

//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);

string exampleJson = null;

var example = exampleJson != null
? JsonConvert.DeserializeObject<Order>(exampleJson)
: default(Order);
//TODO: Change the data returned
return new ObjectResult(example);
}
}
Expand Down
Loading