I wish to generate OpenAPI Document using NSwag for my ASP.NET Controller methods, but with custom OpenAPI Extensions.
Example: Here's a part of my OpenAPI spec. I want to mention SLA of each path:
/v1/address/verifyAddress:
put:
summary: Verify address
operationId: verifyAddress
produces:
- application/json
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/Address'
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Address'
x-sla:
responseTime: '100'
availability: '85'
requestsPerSecond: '50'
Is it possible to add an attribute on the controller to achieve this through NSwag? If not, any suggestions to do this programmatically in ASP.NET Core?
[HttpPut]
[Route("verifyAddress")]
[ProducesResponseType(typeof(ApiDetailsModel), statusCode: 200)]
[SwaggerOperation("validateAddress")]
public async Task<IActionResult> VerifyAddress([FromBody] AddressModel model)
{}
Thanks!