0

I am trying to learn asp.net core web api development. And as usual, I started with debugging the template project generated by VS 2019. But the test page which is appearing when I debug, is not the same as described on the tutorials. It is annoying and after wasting several hours with googling I decided to ask stackoverflow. Which configration am I missing?

The test/output page When I debug: ( actually there is not any button.) enter image description here

However the expected web page is as shown in the enter image description here

Note: the picture of expected webpage is taken from: The video is here

2
  • I'm a little confused. Are these supposed to be the same page? They have completely different URLs. One is an HTML endpoint (and ends with .html.) and the other seems to be a JSON endpoint (with no extension on the end of the URL). Commented May 3, 2021 at 17:41
  • Thank you. But as @Yinqui explained this is related with SwaggerUI support. and actually it is coming automatically, if .NET 5 is targettted and OpenAPI is opted in when you create the new project. Commented May 4, 2021 at 4:50

1 Answer 1

1

First of all, these are two different pages, you can enter the url:https://localhost:xxxxx/swagger/index.htmlto reach the expected SwaggerUI page.

About official document.

Launch the app, and navigate to localhost:/swagger/v1/swagger.json. The generated document describing the endpoints appears as shown in OpenAPI specification (openapi.json).

If you want to set SwaggerUI as default start page.You can change the property in your launchSettings.json file.

Open the launchSettings.json file.Change the launchUrl property to swagger.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Now I see it is all related with OpenAPI support and its added by default if .NET5 and OpenAPI support seleceted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.