Files
httprunner/httprunner/loader/schemas/api.schema.json
2020-01-03 17:45:00 +08:00

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]
}
]
}
}
]
}