Back to list
HaibaraAiAPTX

download-swagger-file

by HaibaraAiAPTX

A collection of Claude Code skills for generating type-safe TypeScript models and API clients from OpenAPI/Swagger specifications.

0🍴 0📅 Jan 18, 2026

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

  1. Validates the provided URL is accessible
  2. Downloads the specification file using curl
  3. Detects and validates the file format (JSON/YAML)
  4. Saves the file to the specified output path
  5. 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 to openapi.json in 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:

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

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon