OpenAPI Spec Generator

中级development最低上下文:32K

Generates complete OpenAPI 3.1 specifications from API descriptions, existing code, or route definitions. Includes request/response schemas, authentication, error responses, examples, and server configurations. Produces valid YAML ready for Swagger UI.

使用场景

  • Generating OpenAPI specs from Express/NestJS route handlers
  • Creating API documentation from scratch based on requirements
  • Adding missing schemas and examples to existing specs
  • Converting Postman collections to OpenAPI format
  • Generating client SDKs from specifications

示例提示词

Generate an OpenAPI 3.1 specification for the following API:

Base URL: [e.g., https://api.example.com/v1]
Authentication: [e.g., Bearer token]

Endpoints:
- [list endpoints with methods, paths, and brief descriptions]

Requirements:
- Complete request/response schemas with examples
- Error responses (400, 401, 403, 404, 429, 500)
- Pagination parameters where applicable
- Security scheme definitions
- Server configurations (dev, staging, prod)
- Tags for grouping endpoints

Output: Valid OpenAPI 3.1 YAML

推荐模型

兼容工具

claude-codecursorgithub-copilotkiroany

模态

输入: text, code
输出: code

相关 Skills

作者

OpenModels Community

@openmodelsrun