mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-10 02:09:51 +08:00
59 lines
1.6 KiB
JSON
59 lines
1.6 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
"description": "httprunner api schema definition",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "common.schema.json#/definitions/name"
|
|
},
|
|
"base_url": {
|
|
"$ref": "common.schema.json#/definitions/base_url"
|
|
},
|
|
"variables": {
|
|
"$ref": "common.schema.json#/definitions/variables"
|
|
},
|
|
"request": {
|
|
"$ref": "common.schema.json#/definitions/request"
|
|
},
|
|
"setup_hooks": {
|
|
"$ref": "common.schema.json#/definitions/hook"
|
|
},
|
|
"teardown_hooks": {
|
|
"$ref": "common.schema.json#/definitions/hook"
|
|
},
|
|
"extract": {
|
|
"$ref": "common.schema.json#/definitions/extract"
|
|
},
|
|
"validate": {
|
|
"$ref": "common.schema.json#/definitions/validate"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"request"
|
|
],
|
|
"examples": [
|
|
{
|
|
"name": "demo api",
|
|
"variables": {
|
|
"var1": "value1",
|
|
"var2": "value2"
|
|
},
|
|
"request": {
|
|
"url": "/api/path/$var1",
|
|
"method": "POST",
|
|
"headers": {
|
|
"Content-Type": "application/json"
|
|
},
|
|
"json": {
|
|
"key": "$var2"
|
|
},
|
|
"validate": [
|
|
{
|
|
"eq": ["status_code", 200]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
} |