How do you do?
I had the same issue but resolved it with
- Adding "/openapi/openapi.json" as an argument to the call
app.MapOpenApi();
- Starting httprepl with an extra parameter --openapi /openapi/openapi.json
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When connecting to localhost using httprepl and https, I received the error "Unable to find an OpenAPI description". I am using .NET8
According to the tutorial, this could be caused by an improperly configured dev certificate. Inspecting the certificate shows it is installed properly.
Further research outside the tutorial revealed my issue to be launch settings. Performing the steps on my machine as outlined in the tutorial, the service was not listening at all for https requests.
I think the tutorial could be improved by mentioning to try the command "dotnet run --launch-profile https" or to otherwise modify the launchsettings.json file. This is because recent releases of .NET default to the first profile listed in launchsettings.json when using dotnet run.
Has anyone else in the community has come across this issue, or has anyone found an alternative solution?
This question is related to the following Learning Module
How do you do?
I had the same issue but resolved it with
app.MapOpenApi();
Hi Stanley, Eugene,
Thank you for reaching out to Microsoft Q & A forum.
I have finished the tutorial exercise on, Creating a Web API Project , and I found the instructions straightforward and easy to follow. Following them, I managed to set up a new API application.
1.Build and test the web API
Following the successful build of the web API application, it can be executed from the command line interface. Upon execution, the application will be allocated a specific port number. Subsequently, you can access the application by launching a web browser and entering the URL: https://localhost:{PORT}/weatherforecast, substituting "{PORT}" with the assigned port number. This action will yield the desired results presented in JSON format
I've attached a screenshot for your reference:
Before going through the .http files you must install REST Client extension
Then after going through explore with .http files.
1.Open the ContosoPizza.http file.
This file has been pre-configured with the @ContosoPizza_HostAddress variables and a GET command calling /weatherforecast/ that accepts application/json.
2.Select the Sent Request command above the GET which will send a request to the running service.
I've attached a screenshot for your reference:
Please feel free to contact us if you have any additional questions.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.
Thank you.