api

Define API endpoints in TypeSpec and generate OpenAPI specs and SDKs.

2.2k|199|Updated Jun 6, 2023
One-click install
npx skills add https://github.com/openmeterio/openmeter --skill api-openmeterio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api
Source: https://github.com/openmeterio/openmeter/tree/main/.agents/skills/api
Command: npx skills add https://github.com/openmeterio/openmeter --skill api-openmeterio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of adding or modifying API endpoints, ensuring consistency and correctness in your API definitions and generated code.

Core Features & Use Cases

  • API Definition: Define new API routes, request/response types, and parameters using TypeSpec.
  • OpenAPI Generation: Automatically generate OpenAPI specifications from TypeSpec definitions.
  • SDK Generation: Create client SDKs for various languages (e.g., Go, JavaScript).
  • Server Stub Generation: Generate Go server code stubs for implementing API handlers.
  • Use Case: When developing a new feature that requires a new API endpoint, use this Skill to define the endpoint in TypeSpec, generate the necessary code, and implement the handler logic.

Quick Start

Use the api skill to add a new GET endpoint for retrieving user profiles under the /v3/users path.

Frequently Asked Questions about api

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

FAQPage Schema
How do I define new API endpoints using TypeSpec?

Define new API endpoints in TypeSpec by specifying routes, request/response types, and parameters. The Skill generates OpenAPI specifications, client SDKs, and Go server stubs from your TypeSpec definitions using make commands.

Can I generate OpenAPI specifications and client SDKs from TypeSpec?

Yes, you can generate OpenAPI specifications and client SDKs from TypeSpec. The Skill executes make commands to produce OpenAPI specs, multi-language SDKs, and Go server stubs from your API contract definitions.

What's the best way to update request and response schemas for an existing API?

Update request and response schemas by modifying your TypeSpec definitions. The Skill facilitates modifying API endpoints and regenerates associated artifacts like OpenAPI specifications and client SDKs to maintain consistency.

Does this Skill generate server code stubs for backend development?

Yes, this Skill generates Go server code stubs for backend development. After defining API routes in TypeSpec, it produces server stubs for implementing API handlers along with OpenAPI specs and client SDKs.

Why do I need TypeSpec conventions for API contract management?

TypeSpec conventions ensure consistency and correctness in API definitions and generated code. Adhering to these conventions allows the Skill to properly generate OpenAPI specifications, client SDKs, and server stubs.

Are there limitations when generating multi-language SDKs from TypeSpec?

The Skill supports generating client SDKs for languages like Go and JavaScript. Limitations depend on your TypeSpec definitions and the make commands executed for code generation, ensuring output consistency across generated artifacts.