本文へスキップ
Skillpedia
APIとサーバー(バックエンド)40k · #7313

openapi-to-application-code

できること

このツールは、API(OpenAPIと呼ばれる)の仕様を記述したファイルから、すぐに使える完全なアプリケーションを作成します。APIがどのように動くべきかを理解し、必要なコードを生成します。

使う場面

  • ✓APIの仕様書があり、それを使うアプリケーションがほしいとき。
  • ✓既存のAPIをもとに、アプリケーションの試作品をすばやく作りたいとき。
  • ✓新しいプロジェクトを始めるときに、基本的なコードの骨組みの作成を自動化したいとき。

スキルのリンク

https://github.com/github/awesome-copilot/blob/main/skills/openapi-to-application-code/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/github/awesome-copilot/blob/main/skills/openapi-to-application-code/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“'https://api.example.com/v2/openapi.json' にあるOpenAPI仕様から、'Spring Boot' フレームワークと 'JWT' 認証を使ったアプリケーションを生成して。”

毎週5つの新しいスキル。1分で読めます。

仕組み

AIはAPIの仕様書(OpenAPI)を読み取り、扱うデータと利用できる機能を理解します。次に、アプリケーションの構造を組み立て、リクエストの受け取り、データの処理、レスポンスの返信などの各部分のコードを書き、テストとドキュメントも追加します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Generate Application from OpenAPI Spec

Your goal is to generate a complete, working application from an OpenAPI specification using the active framework's conventions and best practices.

Input Requirements

  1. OpenAPI Specification: Provide either:

    • A URL to the OpenAPI spec (e.g., https://api.example.com/openapi.json)
    • A local file path to the OpenAPI spec
    • The full OpenAPI specification content pasted directly
  2. Project Details (if not in spec):

    • Project name and description
    • Target framework and version
    • Package/namespace naming conventions
    • Authentication method (if not specified in OpenAPI)

Generation Process

Step 1: Analyze the OpenAPI Specification

  • Validate the OpenAPI spec for completeness and correctness
  • Identify all endpoints, HTTP methods, request/response schemas
  • Extract authentication requirements and security schemes
  • Note data model relationships and constraints
  • Flag any ambiguities or incomplete definitions

Step 2: Design Application Architecture

  • Plan directory structure appropriate for the framework
  • Identify controller/handler grouping by resource or domain
  • Design service layer organization for business logic
  • Plan data models and entity relationships
  • Design configuration and initialization strategy

Step 3: Generate Application Code

  • Create project structure with build/package configuration files
  • Generate models/DTOs from OpenAPI schemas
  • Generate controllers/handlers with route mappings
  • Generate service layer with business logic
  • Generate repository/data access layer if applicable
  • Add error handling, validation, and logging
  • Generate configuration and startup code

Step 4: Add Supporting Files

  • Generate appropriate unit tests for services and controllers
  • Create README with setup and running instructions
  • Add .gitignore and environment configuration templates
  • Generate API documentation files
  • Create example requests/integration tests

Output Structure

The generated application will include:

project-name/
├── README.md                      # Setup and usage instructions
├── [build-config]                 # Framework-specific build files (pom.xml, build.gradle, package.json, etc.)
├── src/
│   ├── main/
│   │   ├── [language]/
│   │   │   ├── controllers/       # HTTP endpoint handlers
│   │   │   ├── services/          # Business logic
│   │   │   ├── models/            # Data models and DTOs
│   │   │   ├── repositories/      # Data access (if applicable)
│   │   │   └── config/            # Application configuration
│   │   └── resources/             # Configuration files
│   └── test/
│       ├── [language]/
│       │   ├── controllers/       # Controller tests
│       │   └── services/          # Service tests
│       └── resources/             # Test configuration
├── .gitignore
├── .env.example                   # Environment variables template
└── docker-compose.yml             # Optional: Docker setup (if applicable)

Best Practices Applied

  • Framework Conventions: Follows framework-specific naming, structure, and patterns
  • Separation of Concerns: Clear layers with controllers, services, and repositories
  • Error Handling: Comprehensive error handling with meaningful responses
  • Validation: Input validation and schema validation throughout
  • Logging: Structured logging for debugging and monitoring
  • Testing: Unit tests for services and controllers
  • Documentation: Inline code documentation and setup instructions
  • Security: Implements authentication/authorization from OpenAPI spec
  • Scalability: Design patterns support growth and maintenance

Next Steps

After generation:

  1. Review the generated code structure and make customizations as needed
  2. Install dependencies according to framework requirements
  3. Configure environment variables and database connections
  4. Run tests to verify generated code
  5. Start the development server
  6. Test endpoints using the provided examples

Questions to Ask if Needed

  • Should the application include database/ORM setup, or just in-memory/mock data?
  • Do you want Docker configuration for containerization?
  • Should authentication be JWT, OAuth2, API keys, or basic auth?
  • Do you need integration tests or just unit tests?
  • Any specific database technology preferences?
  • Should the API include pagination, filtering, and sorting examples?
よくある質問

OpenAPI仕様とは何ですか?

APIの仕組みを記述したファイルです。受け取るデータや返すデータ、実行できる操作の内容が詳しく書かれています。

生成されたアプリケーションはすぐに動きますか?

はい。完全で動作するアプリケーションを生成し、設定してすぐに実行できる状態にすることを目指しています。

アプリケーションに使う技術を選べますか?

はい。API仕様であらかじめ決まっていない場合は、使いたいフレームワークやその他の技術を指定できます。

詳細

作者による元の説明

Generate a complete, production-ready application from an OpenAPI specification

repo: github/awesome-copilot

人気

GitHubのスター
40k
ランキング
#7313
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル