Closed VladisS-Vostok2000Work closed 2 months ago
using NSwag;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
namespace SI.NonTrade.WebApi;
innal class DocCardsOperationProcessor : IOperationProcessor
{
public bool Process(OperationProcessorContext context)
{
IList<OpenApiParameter> apiParameters = context.OperationDescription.Operation.Parameters;
foreach (OpenApiParameter apiParameter in apiParameters)
{
apiParameter.Schema = new()
{
Type = apiParameter.Type,
Format = apiParameter.Format,
IsNullableRaw = apiParameter.IsNullableRaw
};
}
return true;
}
}
Is my solution.
Hello there! For some reason![image](https://github.com/RicoSuter/NSwag/assets/146354591/ad43e8c2-71ad-4ff0-8dc6-cd26632d0b93)
Swagger UI
does not show endpoint parameters data types:I found that
Swagger UI
needs parameter schema for that. I cant find it injson
document:I can add schema manually:
with processor:
But this processor can't process complex parameters (
[FromQuery] MyRequest
, whereMyRequest
is class).Is there any configuration to enable daya types displaying?
Thanks!