Command-line tool that extracts and lists API routes from Swagger files in YAML or JSON format.
Project description
swagroutes
swagroutes is a command-line tool that extracts and lists API routes from Swagger files in YAML or JSON format. It simplifies the process of fetching the routes provided by an API and supports processing multiple files or directories at once.
Install
pip install swagroutes
Upgrade
pip install -U swagroutes
Usage
To use swagroutes, simply provide input files or directories containing Swagger files as arguments. The tool will process the files and print the extracted routes.
Single YAML or JSON file
swagroutes file.yaml
swagroutes file.json
Multiple YAML and/or JSON files
swagroutes file1.yaml file2.json
Directory containing Swagger files
swagroutes directory/
Mix of files and directories
swagroutes file1.yaml directory1/ file2.json directory2/
Output to a file
Save the extracted routes to an output file using the -o
or --output
option:
swagroutes file.yaml -o output.txt
Examples
Given a Swagger file with the following content:
basePath: /api
paths:
/users:
get: {}
post: {}
/profile/{profile_id}:
put: {}
swagroutes will output:
GET /api/users
POST /api/users
PUT /api/profile/{profile_id}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for swagroutes-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98b6800990808c8dad9e7062d5cde85344f29b33b559e5714e91a809ff9c571 |
|
MD5 | 4f8d57b6f0c169e6e28b8a5f6649cc17 |
|
BLAKE2b-256 | 102db0087b30560a9b95eb1f7cd3a13703f9bc379efeaf0a241c042ed8083ba3 |