Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

openapi-parseropenapi 解析器

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

2,225

周安装

90

GitHub Stars

公开资料未说明

下载量

698
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openapi-parser(openapi 解析器)
来源仓库:https://github.com/kevinrvaz/openapi-parser
安装命令:
openclaw skills install openapi-parser
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openapi-parser

简介

openapi-parser 用于解析 OpenAPI 规范并生成 Drift 测试用例。

  • 适合在 OpenClaw 中需要搭建接口漂移检测时使用。
  • 支持复杂规范的自动化测试场景映射。
  • 安装命令:openclaw skills install openapi-parser,需确认测试框架兼容性。
  • 建议定期更新测试套件以反映 API 变更历史。

SKILL.md

name
openapi-parser
description
>
argument-hint
[path/to/openapi-spec.yaml]
metadata
context
fork
agent
general-purpose

OpenAPI Parser Skill

Reference files

(anyOf / oneOf / allOf / discriminator / $ref / enum / pattern / nullable / optional), with real examples from snyk, digitalocean, posthog, and front/core specs

including datasets, expressions, lifecycle hooks for stateful cases, and expected response matchers for each pattern type

Workflow

OpenAPI version: This skill targets OpenAPI 3.x. Swagger 2.0 specs use the same structural patterns ($ref, allOf, oneOf) but different envelope syntax — you may need to adapt field names manually. If working from the konfig-sdks/openapi-examples collection, see references/example-repos.md for navigation commands.

1. Locate the endpoint

Extract only what's needed:

# Find the line number of the endpoint (macOS/Linux/Git Bash/WSL)
grep -n "^  /path/to/endpoint" spec.yaml

# Read just that block (adjust line range as needed)
# Then follow each $ref to components/schemas
grep -n "SchemaName:" spec.yaml
# PowerShell equivalents (Windows)
Select-String -Path spec.yaml -Pattern "^  /path/to/endpoint" | Select-Object LineNumber, Line
Select-String -Path spec.yaml -Pattern "SchemaName:" | Select-Object LineNumber, Line

Extract: path/query/header parameters, request body schema, and each response status code's schema.

2. Resolve $refs recursively

  1. Grep for Foo: in the spec to find its definition block
  2. If Foo itself contains refs, resolve those too
  3. Stop at primitive types (string, integer, boolean, array, object)

allOf: [$ref: Base, properties: {...}] is inheritance — merge Base fields with local properties to get the full schema. See references/schema-patterns.md for all patterns.

3. Enumerate viable combinations

For each response status code, enumerate structurally distinct schema variants. Aim for minimum tests that maximise schema coverage — not a combinatorial explosion of optional field permutations.

PatternTests to generate
oneOf / anyOf with N branchesN tests — one per branch
discriminator with N mapping valuesN tests — one per discriminator value
allOf (composition / inheritance)1 test — merge all schemas into one payload
enum1 test covers it; add boundary variants only if the value drives behaviour
Optional field cluster2 tests: one with all optional fields, one without
nullable fieldCovered by happy path; add null variant only if it changes behaviour
pattern (regex)1 valid example matching the pattern; 1 invalid for negative testing

4. Generate Drift test cases

For each combination produce a Drift operation block. See references/drift-mapping.md for full patterns. Key conventions:

  • Name operations as {operationId}_{variant} — e.g. getImage_byId, getImage_bySlug
  • For discriminated unions, set the discriminator property explicitly in the request body
  • For anyOf path parameters, write one test per type variant
  • Use dataset for test data; use inline parameters only for static, non-variant values (e.g. a fixed enum query param like type: user)
  • For 401 tests, strip global auth with exclude: [auth] and pass an invalid bearer token explicitly
  • Add ignore: { schema: true } to any operation that sends an intentionally invalid request body
  • Tag each test to indicate which schema branch it covers
  • Omitting body from expected lets Drift validate the response against the OpenAPI schema automatically; add explicit body matchers only when asserting a specific field value (e.g. the discriminator property came back correctly)

5. Output format

Always produce:

  1. Analysis — number of status codes, which schemas are polymorphic, how many tests

will be generated and why

  1. Drift operations YAML — the complete operations: block, ready to paste
  2. Dataset YAML (if needed) — the datasets: block for any referenced test data
  3. Gaps — schema combinations intentionally excluded, with the reason

Example

Given GET /v2/images/{image_id} where image_id: anyOf: [integer, string]:

operations:
  getImage_byId:
    target: source-oas:getImage
    tags: [images, param-integer]
    parameters:
      path:
        image_id: ${image-data:images.existing.id}
    expected:
      response:
        statusCode: 200

  getImage_bySlug:
    target: source-oas:getImage
    tags: [images, param-string]
    parameters:
      path:
        image_id: ${image-data:images.existing.slug}
    expected:
      response:
        statusCode: 200

  getImage_notFound:
    target: source-oas:getImage
    parameters:
      path:
        image_id: ${image-data:notIn(images.*.id)}
    expected:
      response:
        statusCode: 404

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.95%
按下载量换算684

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills