Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route: fillter in UseRoutes excludes the majority of my routes #12

Open
lordfeck opened this issue Sep 9, 2024 · 0 comments
Open

Route: fillter in UseRoutes excludes the majority of my routes #12

lordfeck opened this issue Sep 9, 2024 · 0 comments

Comments

@lordfeck
Copy link

lordfeck commented Sep 9, 2024

I see this line in UseRoutes:

var conventionalRouteEndpoints = endpointDataSource.Endpoints.Where(e => e.DisplayName.StartsWith("Route:"));
It is filtering out the majority of my routes when defined using app.UseEndpoints() which do not have a display name beginning with Route, rather they begin with my project's namespace:

Screenshot 2024-09-09 at 3 49 58 pm

The result is that I see only two routes out of the dozens in my application.

For reference my routes are declared thusly in Program.cs:

    // Configure the router
    app.UseEndpoints(endpoints =>
    {
        endpoints.MapControllers();
        endpoints.MapControllerRoute(name: "areas", pattern: "api/{area:exists}/{controller=Reception}/{action=Index}/{id?}");
        endpoints.MapControllerRoute(name: "default", pattern: "api/{controller=Home}/{action=Index}/{id?}");
        endpoints.MapRhbIdentityApi<User>();
   
        // Pass the conventional routes to the generator
        ConventionalRoutingSwaggerGen.UseRoutes(endpoints);
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant