mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-06 15:40:54 +00:00
[aspnetcore] Support cookie parameter (#3490)
* Fix typo useDefaultRoutng to useDefaultRouting * support the cookie functionality in aspnetcore * Changes like wing328 comments
This commit is contained in:
parent
3b584c2138
commit
f90507b527
@ -40,9 +40,14 @@ namespace {{apiPackage}}
|
|||||||
[SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}}
|
[SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}}
|
||||||
[SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}}
|
[SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}}
|
||||||
[ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}
|
[ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}
|
||||||
public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{^generateBody}};{{/generateBody}}
|
public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}{{^isCookieParam}}, {{/isCookieParam}}{{/hasMore}}{{/allParams}}){{^generateBody}};{{/generateBody}}
|
||||||
{{#generateBody}}
|
{{#generateBody}}
|
||||||
{ {{#responses}}
|
{
|
||||||
|
{{#cookieParams}}
|
||||||
|
var {{paramName}} = Request.Cookies["{{paramName}}"];
|
||||||
|
{{/cookieParams}}
|
||||||
|
|
||||||
|
{{#responses}}
|
||||||
{{#dataType}}
|
{{#dataType}}
|
||||||
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//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}}));
|
// return StatusCode({{code}}, default({{&dataType}}));
|
||||||
@ -50,7 +55,8 @@ namespace {{apiPackage}}
|
|||||||
{{^dataType}}
|
{{^dataType}}
|
||||||
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode({{code}});
|
// return StatusCode({{code}});
|
||||||
{{/dataType}}{{/responses}}
|
{{/dataType}}
|
||||||
|
{{/responses}}
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
string exampleJson = null;
|
string exampleJson = null;
|
||||||
{{#examples}}
|
{{#examples}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user