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

Fixup /swagger root urls #386

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

tlmii
Copy link
Member

@tlmii tlmii commented Sep 10, 2020

As of .NET 5 RC1, the dotnet new webapi template now has a default start url of swagger. Because the default Swashbuckle-generated OpenAPI description doesn't contain a Servers element, this will put HttpRepl users that launch from VS/VS Code into a pit of failure by having a base address of https://localhost:{port}/swagger/, even though the API is, by default, based at the root. The user won't be able to navigate their API at all, because you can't navigate "above" the base address.

Since it is unlikely a user would put their API inside the /swagger path, we will special-case this scenario and remove that from the url. We will give the user an escape hatch via the preference if they do put their API under that path.

@tlmii tlmii added this to the 5.0.0 milestone Sep 10, 2020
@tlmii tlmii self-assigned this Sep 10, 2020
Copy link
Member

@bradygaster bradygaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent and cc @coolcsh fyi

Copy link

@bzhu94 bzhu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tlmii tlmii merged commit 50085b0 into dotnet:master Sep 10, 2020
@tlmii tlmii deleted the dev/timulhol/default-template-switch branch September 10, 2020 21:54
@tlmii tlmii removed this from the 5.0.0 milestone Sep 10, 2020
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

Successfully merging this pull request may close these issues.

3 participants