OpenAPI Swagger Preview
OpenAPI (Swagger) Editor is an optional extension that can be added to your VS Code.
Setup
Install the OpenAPI (Swagger) Editor from Extensions (CTRL+SHIFT+X) and follow the instructions.
Environment
Change the server section of the OpenAPI definition of the service to use the host URL _http://localhost:7071/<openapi_name_in_lowercase>/{basePath}_.
In the BaaS Service Explorer node of an OpenAPI file, there is a context-menu option 'Set local Swagger server path".
The command inserts the correct URL in the OpenAPI file at the top of the servers section.
An import of an existing OpenAPI file also executes the command to ensure there is a correct local Swagger server path.
Test the Locally Running Service
- Start the 'Azurite Blob Service' accessible in the status bar.
- Start the 'Azurite Queue Service' accessible in the status bar.
- Start debugging or run the Service in Visual Studio Code from the 'Run and Debug' view container.
- Select the 'Swagger Preview' command on the OpenAPI definition for the Service.
- Expand the Swagger Preview section with the method to call:
- Press the 'Try it Out' button.
- Enter required parameters if any.
- Press the 'Execute' button.
- Wait for the response.