Skip to content

Unable to call UseSwagger() before MapGet() in minimal API #979

@Martinn2

Description

@Martinn2

Describe the bug

I have issue with swaggerUI when having multiple versions combobox.
In all the examples, app.UseSwagger() and app.UseSwaggerUI() is called after MappingEndpoints. If I do UseSwagger() first, the version combox stops working (shows only v1). But in real application I need to execute app.UseSwagger() then app.UseAuthentication() then app.UseAuthorization() and then MappingEndpoints to preven swagger.index from getting 401 (I do not secure swagger endpoint).

Expected Behavior

I want to be able to call app.UseSwagger() and app.UseSwaggerUI() before MappingEndpoint (MapPost, MapGet etc.) and stil have version combobox working in swagger UI

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions