Search code examples
c#swaggerfast-endpoints

FastEndpoints parameter not created in swagger


Simple configuration of application Simple configuration of application

Added an endpoint with id parameter Added an endpoint with id parameter

parameter is not showed in swagger parameter id is not showed in swagger

I'am working with FastEndPoints 5.23.0 What could be the issue? I've followed the documentation (https://dev.fastendpoints-doc-site.pages.dev/docs/model-binding#from-route-parameters)


Solution

  • your swagger middleware setup is wrong.

    using FastEndpoints;
    using FastEndpoints.Swagger; //add this
    
    var bld = WebApplication.CreateBuilder();
    bld.Services
       .AddFastEndpoints()
       .SwaggerDocument(); //define a swagger document
    
    var app = bld.Build();
    app.UseFastEndpoints()
       .UseSwaggerGen(); //add this
    app.Run();
    

    fastendpoints uses nswag and doesn't support swashbucke, which i believe is what you're trying with.