v0-json-schema

This commit is contained in:
gongwenxin
2025-05-16 15:18:02 +08:00
parent 32676a314f
commit 6d0b70fe11
260 changed files with 280278 additions and 0 deletions
@@ -0,0 +1,18 @@
{
"id": "restful-url-pattern",
"name": "RESTful URL设计规则",
"description": "验证API URL是否符合RESTful设计规范",
"category": "APIDesign",
"version": "1.0.0",
"severity": "warning",
"source": null,
"is_enabled": true,
"tags": null,
"target_type": "APIRequest",
"target_identifier": null,
"lifecycle": "请求准备阶段",
"scope": "请求URL",
"code": null,
"design_aspect": "URL设计",
"pattern": "^/api/v\\d+/[a-z0-9-]+(/[a-z0-9-]+)*$"
}
@@ -0,0 +1,19 @@
{
"id": "standard-error-response",
"name": "标准错误响应格式规则",
"description": "验证API错误响应是否符合标准格式",
"category": "ErrorHandling",
"version": "1.0.0",
"severity": "warning",
"source": null,
"is_enabled": true,
"tags": null,
"target_type": "APIResponse",
"target_identifier": null,
"lifecycle": "响应验证阶段",
"scope": "响应体",
"code": null,
"error_code": "*",
"expected_status": 400,
"expected_message": null
}
@@ -0,0 +1,19 @@
{
"id": "response-time-max-500ms",
"name": "响应时间不超过500毫秒",
"description": "验证API响应时间不超过500毫秒",
"category": "Performance",
"version": "1.0.0",
"severity": "warning",
"source": null,
"is_enabled": true,
"tags": null,
"target_type": "APIResponse",
"target_identifier": null,
"lifecycle": "响应验证阶段",
"scope": "响应时间",
"code": null,
"threshold": 500.0,
"metric": "response_time",
"unit": "ms"
}
+18
View File
@@ -0,0 +1,18 @@
{
"id": "https-only-rule",
"name": "HTTPS强制使用规则",
"description": "验证API请求是否使用了HTTPS协议",
"category": "Security",
"version": "1.0.0",
"severity": "error",
"source": null,
"is_enabled": true,
"tags": null,
"target_type": "APIRequest",
"target_identifier": null,
"lifecycle": "请求准备阶段",
"scope": "安全性",
"code": null,
"check_type": "transport_security",
"expected_value": "https"
}