forked from loafle/openapi-generator-original
[BUG] C# Aspnetcore Adding Name property for header parameters (#16360)
* Adding Name property for header param * update samples * update samples * update doc --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
1a458d3e0b
commit
32fe92fee9
@ -1 +1 @@
|
||||
{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
||||
{{#isHeaderParam}}[FromHeader (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
@ -1 +1 @@
|
||||
{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
||||
{{#isHeaderParam}}[FromHeader (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
@ -1 +1 @@
|
||||
{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
||||
{{#isHeaderParam}}[FromHeader (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}}
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string? apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string? apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[HttpDelete]
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey);
|
||||
public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// Finds Pets by status
|
||||
|
@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
[Route("/v2/pet/{petId}")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("DeletePet")]
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey)
|
||||
public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey)
|
||||
{
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user