
download-swagger-file
by HaibaraAiAPTX
A collection of Claude Code skills for generating type-safe TypeScript models and API clients from OpenAPI/Swagger specifications.
SKILL.md
name: download-swagger-file description: Download Swagger/OpenAPI specification file from a URL. Use phrases like "Download swagger file", "Fetch OpenAPI spec", "Get API documentation", etc.
Download Swagger/OpenAPI File
Downloads an OpenAPI (Swagger) specification file from a remote URL and saves it locally. Supports both JSON and YAML formats for OpenAPI 2.0 and 3.x specifications.
How It Works
- Validates the provided URL is accessible
- Downloads the specification file using curl
- Detects and validates the file format (JSON/YAML)
- Saves the file to the specified output path
- Returns the file path and basic metadata
Usage
bash /mnt/skills/user/download-swagger-file/scripts/download.sh <url> [output-path]
Arguments:
url- The URL of the OpenAPI/Swagger specification file (required)output-path- Local file path to save the downloaded file (optional, defaults toopenapi.jsonin current directory)
Examples:
Download to default location:
bash /mnt/skills/user/download-swagger-file/scripts/download.sh https://api.example.com/swagger.json
Download with custom output path:
bash /mnt/skills/user/download-swagger-file/scripts/download.sh https://api.example.com/swagger.json ./specs/my-api.json
Download YAML specification:
bash /mnt/skills/user/download-swagger-file/scripts/download.sh https://api.example.com/openapi.yaml ./docs/api.yaml
Output
{
"success": true,
"filePath": "./specs/petstore.json",
"format": "json",
"size": 15234,
"url": "https://petstore.swagger.io/v2/swagger.json"
}
Present Results to User
Successfully downloaded OpenAPI specification:
- File:
./specs/petstore.json - Format: JSON
- Size: 15.2 KB
- Source: https://petstore.swagger.io/v2/swagger.json
The file is ready to use with other OpenAPI skills for generating TypeScript models and API clients.
Troubleshooting
Error: Failed to download file
- Check that the URL is accessible in a browser
- Verify the server has CORS enabled if accessed from a browser
- Ensure the URL points directly to the JSON/YAML file, not a documentation page
Error: Invalid OpenAPI format
- Verify the downloaded file is a valid OpenAPI/Swagger specification
- Check that the file is not HTML (common when URL points to docs page instead of raw spec)
- Use a JSON/YAML validator to check file syntax
Error: Permission denied writing to output path
- Ensure you have write permissions for the output directory
- Try specifying a different output path in a writable location
- Create the target directory before running the script
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon
