FastEndpoints: Route parameter property type not correctly set with swagger
Hi,
this issue is referencing to #99 Route parameter property type not correctly set with swagger
In my case the issue is not solved with the newest Version 5.24.0
my example Endpoint:
sealed class GetUserEndpoint : EndpointWithoutRequest
{
public override void Configure()
{
Get("/users/{UserId}");
Options(x => x.WithTags("Test"));
AllowAnonymous();
}
public override async Task HandleAsync(CancellationToken cancellationToken)
{
var logger = Resolve<ILogger<GetUserEndpoint>>();
int userId = Route<int>("UserId");
var user = new
{
UserId = userId,
FirstName = "John",
LastName = "Doe",
};
if (user is null)
{
await SendNotFoundAsync(cancellationToken);
return;
}
await SendAsync(user, cancellation: cancellationToken);
}
}
Swagger: No parameters
Program.cs:
...
services.AddFastEndpoints()
.SwaggerDocument();
...
app.UseFastEndpoints(config =>
{
config.Errors.UseProblemDetails();
})
.UseSwaggerGen();
Thank you all, great package
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (11 by maintainers)
Let me check that and get back to ya…