Created
January 30, 2026 05:29
-
-
Save aimtiaz11/af9047933d820f2e052db0c02dfcd14b to your computer and use it in GitHub Desktop.
Swagger API - List all APIs (method and path)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # You can run this script with Python 3.x | |
| import json | |
| import sys | |
| with open(sys.argv[1], 'r', encoding='utf-8') as f: | |
| data = json.load(f) | |
| print(f"{data.get('info', {}).get('title', 'No Title')} - {data.get('info', {}).get('version', 'No Version')}") | |
| for path, methods in data.get('paths', {}).items(): | |
| for method in methods: | |
| if method.upper() in ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD']: | |
| print(f" {method.upper()}: {path}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment