I'm currently using NSwag v14.0.7.0 in my project, and I've encountered an issue where Swagger does not load and the C# client code is not generated for endpoints returning Task.
Reproduction Steps:
Define an endpoint with a return type of Task.
Attempt to load Swagger UI or generate C# client code using NSwag.
Expected Behavior:
Swagger UI should load successfully, and C# client code should be generated for endpoints returning Task, similar to how it worked with Swashbuckle.
Actual Behavior:
Swagger UI does not load, and C# client code is not generated for endpoints returning Task.
Code Snippet:
[HttpPost]
public async Task<BaseResponse<Unit>> Create([FromBody] InvoiceDetail invoiceDetail)
{
var result = await _mediator.Send(new CreateInvoiceDetailCommand { InvoiceDetail = invoiceDetail });
return result;
}
[HttpPost]
public async Task<Unit> Create([FromBody] InvoiceDetail invoiceDetail)
{
var result = await _mediator.Send(new CreateInvoiceDetailCommand { InvoiceDetail = invoiceDetail });
return new MediatR.Unit();
}
Additional Information:
NSwag version: 14.0.7.0
Previously, I was using Swashbuckle, and it worked correctly with this type of endpoint.
I'm currently using NSwag v14.0.7.0 in my project, and I've encountered an issue where Swagger does not load and the C# client code is not generated for endpoints returning Task.
Reproduction Steps:
Expected Behavior:
Swagger UI should load successfully, and C# client code should be generated for endpoints returning Task, similar to how it worked with Swashbuckle.
Actual Behavior:
Swagger UI does not load, and C# client code is not generated for endpoints returning Task.
Code Snippet:
Additional Information: