返回 Skill 列表
extension
分类: 开发与工程无需 API Key

http-api-openapi

保持HTTP处理器和OpenAPI(openapi.yaml)同步。在添加/更改端点、请求/响应模式、身份验证要求或错误格式时使用。

person作者: jakexiaohubgithub

Tooling assumptions

  • Use a terminal runner with bash and git available.
  • Prefer make targets when available; fall back to direct CLI commands when needed.

Source of truth

  • OpenAPI spec: openapi.yaml at the repo root.

Typical workflow

  1. Update openapi.yaml (paths, schemas, auth).
  2. Validate the spec:
make validate-openapi

If swagger-cli isn’t installed:

npm install -g @apidevtools/swagger-cli
  1. Implement the handler changes in Go (and keep auth consistent with the spec).
  2. Run tests:
make test

Project-specific notes

  • Authenticated endpoints use Bearer token auth (see README’s Auth section).
  • Be explicit about error responses and status codes in the spec when behavior changes.