Langsung ke konten
Skillpedia
API & server (backend)40k Β· #7313

openapi-to-application-code

Fungsinya

Alat ini membuat aplikasi lengkap yang siap pakai dari sebuah file yang mendeskripsikan API (disebut OpenAPI). Alat ini memahami bagaimana API seharusnya bekerja dan menghasilkan kode yang dibutuhkan.

Kapan dipakai

  • βœ“Saat Anda memiliki deskripsi API dan ingin membuat aplikasi yang menggunakannya.
  • βœ“Untuk membuat prototipe aplikasi dengan cepat berdasarkan API yang sudah ada.
  • βœ“Saat memulai project baru dan ingin mengotomatisasi pembuatan struktur kode dasar.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/github/awesome-copilot/blob/main/skills/openapi-to-application-code/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuatkan aplikasi dari spesifikasi OpenAPI di 'https://api.example.com/v2/openapi.json', menggunakan framework 'Spring Boot' dan autentikasi 'JWT'.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI membaca deskripsi API (OpenAPI), memahami data dan fungsi yang tersedia. Lalu AI menyusun struktur aplikasi, menulis kode untuk setiap bagian (seperti menerima request, memproses data, dan memberikan respons), serta menambahkan test dan dokumentasi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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?
Pertanyaan umum

Apa itu spesifikasi OpenAPI?

Itu adalah file yang menjelaskan cara kerja sebuah API, termasuk data yang diterima dan dikembalikan, serta aksi apa saja yang bisa dilakukan.

Apakah aplikasi yang dihasilkan langsung berfungsi?

Ya, tujuannya adalah menghasilkan aplikasi yang lengkap dan berfungsi, siap untuk dikonfigurasi dan dijalankan.

Bisakah saya memilih teknologi yang digunakan aplikasi?

Bisa, Anda dapat menentukan framework dan teknologi lain yang diinginkan jika belum ditentukan dalam spesifikasi API.

Detail

Deskripsi asli dari pembuat

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

repo: github/awesome-copilot

Popularitas

Bintang GitHub
40k
Peringkat
#7313
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa