This tool automatically generates .http
files for the VSCode REST Client from an OpenAPI (Swagger) specification. It supports both local and remote (URL) OpenAPI JSON files.
- Fetch OpenAPI JSON from a URL or a local file.
- Generate
.http
files compatible with the VSCode REST Client. - Handle path and query parameters, including enum options.
Before you begin, ensure you have met the following requirements:
- Python 3.x
requests
library for Python (Install usingpip install requests
)
To use the OpenAPI to VSCode REST Client Generator, follow these steps:
- Clone or download this repository to your local machine.
- Install the required Python packages using
pip install -r requirements.txt
. - Run the script using the following command:
The file can be loaded locally or pulled directly from an url e.g https://petstore.swagger.io/v2/swagger.json
python gen_openapi_rest.py <swagger-json-source> <output-http-file>