Yunqi (ClickZetta / Singdata Lakehouse) · API Governance Rules
Yunqi (ClickZetta / Singdata Lakehouse) API Rules
Spectral linting rules defining API design standards and conventions for Yunqi (ClickZetta / Singdata Lakehouse).
26 Rules
error 9
warn 13
info 4
Rules by declared severity: the level each rule assigns to a violation. These are not lint results.
Published by Yunqi (ClickZetta / Singdata Lakehouse)
Authored by the provider — source: https://www.yunqi.tech/apis/rules/yunqi-rules.yml.
Rule Categories
yunqi
Rules
warn
yunqi-info-contact
info.contact 需要写明团队名称和对外邮箱。
$.info
warn
yunqi-info-description-length
info.description 至少 50 个字符,说明接口用途和认证方式。
$.info.description
error
yunqi-servers-official-host
servers 只能使用官方生产域名(api.clickzetta.com、.api.clickzetta.com、.api.singdata.com),不能写 localhost、内网地址、模板变量或无法解析的 api.singdata.com。
$.servers[*].url
warn
yunqi-server-description
每个 server 需要说明对应的区域或环境。
$.servers[*]
error
yunqi-path-prefix
开放平台接口路径必须以 /openapi/v2/ 开头。
$.paths
warn
yunqi-path-segment-camel-case
路径段使用 lowerCamelCase(如 getPublicKey、adhoc),不使用下划线或连字符。
$.paths
error
yunqi-path-no-trailing-slash
路径不能以 / 结尾。
$.paths
error
yunqi-operation-summary
每个操作都要有 summary(建议用中文)。本规则只检查字段是否存在。
#Operation
warn
yunqi-operation-description
每个操作都要有 description,说明行为、前置条件和副作用。
#Operation
error
yunqi-operation-single-tag
每个操作有且只有一个 tag,对应所属的 API。
#Operation
warn
yunqi-operation-id-camel-case
operationId 使用 lowerCamelCase 动宾结构,如 createVirtualCluster。
#Operation.operationId
error
yunqi-operation-success-response
每个操作必须定义 2xx 响应。
#Operation.responses
warn
yunqi-operation-error-response
每个操作至少定义一个 4xx 响应(签名错误、参数错误、资源不存在等)。
#Operation.responses
info
yunqi-operation-rate-limit-response
推荐为每个操作声明 429 响应。本规则只检查是否声明了 429,不检查 Retry-After 响应头。
#Operation.responses
error
yunqi-delete-not-get
删除、停止、下线等有副作用的操作不能用 GET。
$.paths[?(@property.match(/\/(delete|remove|stop|kill|offline|disable|suspend)[A-Za-z]*$/))]
error
yunqi-security-aksk
根级 security 必须同时引用 AccessKeyID 和 RequestSignature(AK/SK 请求签名)。
$
error
yunqi-security-scheme-header-only
认证信息只能放在请求头,不能放在 query string。
$.components.securitySchemes[?(@.type == 'apiKey')]
warn
yunqi-security-scheme-description
每个 securityScheme 都要说明取值方式和签名算法。
$.components.securitySchemes[*]
warn
yunqi-json-only
请求和响应统一使用 application/json。
#Operation.requestBody.content#Operation.responses[?(@property.match(/^2/))].content
warn
yunqi-request-body-ref
请求体 schema 使用 components/schemas 中的命名模型($ref),便于复用和生成 SDK。
#Operation.requestBody.content['application/json'].schema
info
yunqi-media-type-example
推荐为 JSON 请求和响应提供 example 或 examples。
#JsonMediaType
info
yunqi-error-problem-json
推荐 4xx/5xx 响应使用 RFC 9457 application/problem+json。
#Operation.responses[?(@property.match(/^[45]/))].content
warn
yunqi-property-camel-case
字段名使用 lowerCamelCase,例如 workspaceId、vclusterName。
$.components.schemas[*].properties
info
yunqi-schema-description
推荐为 components/schemas 中的每个模型写 description。
$.components.schemas[*]
warn
yunqi-parameter-description
每个参数都要有 description。
#Operation.parameters[?(@.in)]
warn
yunqi-tag-description
根级 tags 需要有 description。
$.tags[*]
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.