O
openapi-specification-v2
by @hairyfv1.0.0
3.7(0)
遵循OpenAPI (Swagger) 2.0规范,用于描述和文档化RESTful API,便于AI工程中的接口集成与协作。
安装方式
npx skills add hairyf/skills --skill openapi-specification-v2compare_arrows
Before / After 效果对比
1 组使用前
传统上,REST API的文档编写和维护常常是独立于代码的,导致文档与实际API不一致,开发人员在理解和使用API时面临挑战。手动更新文档耗时且易错,团队协作效率低下。
使用后
采用OpenAPI 2.0规范后,API文档与代码实现紧密结合,实现了文档的自动化生成和实时更新。这不仅确保了文档的准确性,还极大地简化了前后端开发人员之间的沟通与协作,加速了开发周期。
description SKILL.md
name: openapi-specification-v2 description: OpenAPI (Swagger) 2.0 specification for describing REST APIs. Use when writing, validating, or interpreting Swagger 2.0 specs, generating clients/docs, or working with path/operation/parameter/response/schema/security definitions. metadata: author: hairy version: "2026.1.30" source: Generated from https://github.com/OAI/OpenAPI-Specification, scripts located at https://github.com/antfu/skills
OpenAPI Specification 2.0 (formerly Swagger 2.0) defines a JSON/YAML format for describing RESTful APIs: paths, operations, parameters, responses, schemas, and security. Use this skill when creating or editing Swagger 2.0 specs, validating structure, or generating code/documentation from them.
The skill is based on OpenAPI Specification 2.0, generated at 2026-01-30.
Core References
| Topic | Description | Reference |
|---|---|---|
| Format and Structure | Document format, file structure, data types | core-format-and-structure |
| Fixed and Patterned Fields | Fixed vs patterned field names in the schema | core-fixed-patterned-fields |
| Swagger Object | Root document, required/optional fields, extensions | core-swagger-object |
| Info and Metadata | Info, Contact, License objects | core-info-metadata |
| Tags and External Docs | Tag Object, External Documentation Object | core-tags-and-external-docs |
| Reference Object | $ref, JSON Pointer, same-document and external file references | core-reference-object |
| Data Types and Formats | Primitives, format table, validation, file type | core-data-types-and-formats |
| MIME Types | consumes/produces, RFC 6838, examples | core-mime-types |
| HTTP Status Codes | Response keys, default response, IANA/RFC 7231 | core-http-status-codes |
| Path Templating | Curly braces, path parameters, name matching | core-path-templating |
| Header Object | Response header definition (type, format, items, validation) | core-header-object |
| Headers Object | Container for response headers (name → Header Object) | core-headers-object |
| Items Object | Non-body array items (parameters, headers) | core-items-object |
| Example Object | Response examples by MIME type | core-example-object |
Paths and Operations
| Topic | Description | Reference |
|---|---|---|
| Paths and Operations | Paths Object, Path Item, Operation Object | paths-and-operations |
| Path Item $ref | External path definition, conflict behavior | path-item-ref |
Parameters and Responses
| Topic | Description | Reference |
|---|---|---|
| Parameters | Parameter locations (path, query, header, body, formData) | parameters |
| collectionFormat | csv, ssv, tsv, pipes, multi and where they apply | parameters-collection-format |
| Parameters Definitions (Reuse) | Root-level parameters, reuse via $ref | parameters-definitions-reuse |
| Responses | Responses Object, Response Object | responses |
| Responses Definitions (Reuse) | Root-level responses, reuse via $ref | responses-definitions-reuse |
Schemas and Definitions
| Topic | Description | Reference |
|---|---|---|
| Schema and Definitions | Schema Object, Definitions, composition, polymorphism | schema-and-definitions |
| Schema JSON Schema Keywords | JSON Schema Draft 4 subset and Swagger-specific fields | schema-json-schema-keywords |
Security
| Topic | Description | Reference |
|---|---|---|
| Security | Security Definitions, Security Scheme | security |
| Security Requirement Object | Applying security at root/operation, OR/AND logic | security-requirement-object |
| Scopes Object | OAuth2 scope name → description | security-scopes-object |
| Basic and API Key | basic and apiKey Security Scheme | security-basic-apikey |
| OAuth2 Flows | implicit, password, application, accessCode and required URLs | security-oauth2-flows |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| Spec Authoring | operationId, tags, responses, parameters, definitions, security | best-practices-spec-authoring |
Advanced
| Topic | Description | Reference |
|---|---|---|
| Vendor Extensions | x- prefix, value types, where allowed | advanced-vendor-extensions |
| Security Filtering | Empty Paths, empty Path Item for access control | advanced-security-filtering |
| Extensions and XML | XML Object for schema properties | advanced-extensions-and-xml |
forum用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价,来写第一条吧
统计数据
安装量326
评分3.7 / 5.0
版本1.0.0
更新日期2026年3月16日
对比案例1 组
用户评分
3.7(0)
5
0%
4
0%
3
0%
2
0%
1
0%
为此 Skill 评分
0.0
兼容平台
🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI
时间线
创建2026年3月16日
最后更新2026年3月16日