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

[BUG?] UseSwaggerUI bug when working with different environments #2649

Closed
ghost opened this issue May 10, 2023 · 4 comments
Closed

[BUG?] UseSwaggerUI bug when working with different environments #2649

ghost opened this issue May 10, 2023 · 4 comments
Labels
needs-repro A minimal reproducible example is needed stale Stale issues or pull requests

Comments

@ghost
Copy link

ghost commented May 10, 2023

Hello,

I am building a .NET 6 WEB API which I hosted on IIS.
I am hosting the API in base site, not in a subdirectory.

image

Now, here's what's interesting:

line 68:

IF I set options.RoutePrefix to "routePrefix" variable, I see in logs that options.RoutePrefix is empty in Test environment, BUT when I open the base address, it redirects to index.html and gives me a 404 error.

IF I set options.RoutePrefix to "string.Empty" (ignoring the IF clause in lines 59-62), I see in logs that options.RoutePrefix is empty in Test environment, BUT if I open the base address, it redirects to index.html and shows Swagger UI.

It looks to me as if Swagger ignores the dynamically set "routePrefix"?

@ghost ghost changed the title UseSwaggerUI bug when working with different environments [BUG?] UseSwaggerUI bug when working with different environments May 10, 2023
@Havunen
Copy link

Havunen commented Feb 18, 2024

Can you create a sample application and zip it or upload it to Github and I can then have a look. Also if you are using .Net8 you can test if DotSwashbuckle resolves your issue

@martincostello martincostello added the needs-repro A minimal reproducible example is needed label Apr 14, 2024
@martincostello
Copy link
Collaborator

Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so we can look into this further.

Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Jun 22, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-repro A minimal reproducible example is needed stale Stale issues or pull requests
Projects
None yet
Development

No branches or pull requests

2 participants