API Schema Validator 技能:在 CI 校验 OpenAPI 引用
EnglishClaude Code 安装步骤
- 从 GitHub 固定提交获取完整的 `plugins/api-development/api-schema-validator/skills/validating-api-schemas` 目录。
- 复制到目标项目的 `.claude/skills/`,确认 `.claude/skills/validating-api-schemas/SKILL.md`,再从项目根目录启动 Claude Code,输入 `/validating-api-schemas`。
中文摘要
让 Claude Code 检查 OpenAPI 定义中的引用、结构和覆盖范围,给无效 schema 提供可定位的报告。
SKILL.md 中文导读
可复现示例
让 200 响应引用 #/components/schemas/CatalogItem,但只定义 Item。运行 OpenAPI lint,确认定位到错误引用后把引用名改成已有定义。工作步骤
- 检查操作与 components 里的引用是否能解析,给验证器使用对应的 OpenAPI 版本。
- 将错误位置和缺失对象保留在报告。修正后重跑同一条本地检查。
验收方法
初次报告定位到缺失的 CatalogItem,修复后同一 lint 命令通过。可以在 CI 重用。
GitHub 原文 · 更新日期
适用环境
准备自己的 OpenAPI 文档与项目既有 lint 工具。示例验证定义文件,使用合成商品对象。
常见问题
定义 lint 通过就能证明真实 API 返回符合约定吗?
再加运行时或集成测试验证返回体。定义 lint 负责检查文档自身。
相关指南
相关推荐
groq-install-auth 技能
jeremylongshore/claude-code-plugins-plus-skills
anima-common-errors 技能
jeremylongshore/claude-code-plugins-plus-skills
apple-notes-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
castai-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
cohere-local-dev-loop 技能
jeremylongshore/claude-code-plugins-plus-skills
figma-security-basics 技能
jeremylongshore/claude-code-plugins-plus-skills