i need to set some response example which have same http Status Code by C#.
i have studied the post
https://blog.rsuter.com/nswag-tutorial-implement-a-custom-operation-processor-to-define-redoc-code-samples/
but i still have no idea.
how can i do ?
please give me some hint ...
// i want to create json , like this.
responses:
'404':
description: please , let It worked...
content:
application/json:
schema:
$ref: '#/components/schemas/TestModel'
examples:
success :
summary: Example of a successful response
value:
code : 1
message : "test message 1"
success2 :
summary: Example of a successful response2
value:
code : 2
message: "test message 2"
update :
i use NSwag , like this
i need to let code 404 have two Example response
/// <summary></summary>
/// <remarks></remarks>
/// <response code="200"></response>
/// <response code="404">Message 1</response>
/// <response code="404">Message 2</response> // <---- error will occur ,
[HttpPost]
[ProducesResponseType(typeof(CreateIdentificationResponse), 200)]
[ProducesResponseType(typeof(ErrorResponse), 404)]
[ProducesResponseType(typeof(ErrorResponse), 404)]
public IActionResult Post(){
}