api-skill

Regenerate API models and implement routes from an OpenAPI specification.

6|5|Updated Dec 16, 2022
One-click install
npx skills add https://github.com/6529-Collections/6529seize-backend --skill api-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-skill
Source: https://github.com/6529-Collections/6529seize-backend/tree/main/.agentconf/skills/api-skill
Command: npx skills add https://github.com/6529-Collections/6529seize-backend --skill api-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of defining, implementing, and validating API endpoints, ensuring consistency and adherence to best practices within the repository.

Core Features & Use Cases

  • API Contract Definition: Define API specifications using openapi.yaml.
  • Automated Model Generation: Regenerate API request/response models from the OpenAPI specification.
  • Manual Route Implementation: Implement API routes, ensuring alignment with the contract and including validation and authentication.
  • Use Case: When developing a new microservice or adding functionality to an existing one, use this Skill to define the API contract, generate necessary data models, and implement the corresponding routes with proper validation and authentication.

Quick Start

Use the api-skill to update the openapi.yaml file and regenerate API models.

Frequently Asked Questions about api-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build API endpoints from an OpenAPI specification?

Generating REST API models from an OpenAPI specification involves updating the openapi.yaml contract and regenerating the corresponding request and response data models. After generation, you manually implement the backend routes and wire validation, authentication, and timing mechanisms.

What is the best way to update existing API request and response models?

Updating existing API request and response models requires modifying the OpenAPI specification and regenerating the models. This ensures consistency with the API contract before you manually adjust the implementation of the backend routes.

Can I use this approach to add validation and authentication to new REST routes?

Yes, adding validation and authentication to new REST routes is supported. After defining the API contract and generating models, you manually implement the routes and wire the validation, authentication, and timing mechanisms directly into the backend code.

Does this workflow require manual route implementation after generating models?

Yes, this workflow requires manual route implementation after generating models. While the OpenAPI specification automates model generation, developers must manually implement the actual API routes and correctly wire validation and authentication mechanisms.

When do I need to regenerate API models from an OpenAPI specification?

You need to regenerate API models from an OpenAPI specification when creating a new API, altering an existing one, or updating API request and response models. This ensures the backend models align with the updated openapi.yaml contract.