mirror of https://github.com/Seich/Beau.git
123 lines
4.2 KiB
JSON
123 lines
4.2 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
"$id": "https://beaujs.com/schema.json",
|
|
"title": "Beaujs Requests Schema",
|
|
"type": "object",
|
|
"definitions": {
|
|
"request": {
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{
|
|
"type": "object",
|
|
"$ref": "#/definitions/requestObject",
|
|
"required": ["alias"]
|
|
}
|
|
]
|
|
},
|
|
"requestObject": {
|
|
"type": "object",
|
|
"properties": {
|
|
"alias": {
|
|
"type": "string",
|
|
"description": "The name of this request."
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"description": "Headers that are part of this request."
|
|
},
|
|
"params": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"description": "Query String parameters to add to this request."
|
|
},
|
|
"payload": {
|
|
"description": "This request's body. It is converted to json automatically if given an object. It's sent as a string otherwise.",
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
]
|
|
},
|
|
"form": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"description": "This request's body. Sets the content-type to application/x-www-form-urlencoded."
|
|
},
|
|
"formdata": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"description": "This request's body. Sets the content-type to multipart/form-data."
|
|
}
|
|
},
|
|
"allOf": [
|
|
{ "not": { "required": ["payload", "form"] } },
|
|
{ "not": { "required": ["payload", "formdata"] } },
|
|
{ "not": { "required": ["formdata", "form"] } }
|
|
]
|
|
}
|
|
},
|
|
"properties": {
|
|
"version": {
|
|
"type": "number",
|
|
"description": "The beau version this document was created for.",
|
|
"enum": [1]
|
|
},
|
|
"endpoint": {
|
|
"type": "string",
|
|
"description": "The root endpoint for this host."
|
|
},
|
|
"cookiejar": {
|
|
"type": "boolean",
|
|
"description": "Enable cookie support for requests?"
|
|
},
|
|
"host": {
|
|
"type": "string",
|
|
"description": "The name of the current host. It allows referencing requests between different hosts."
|
|
},
|
|
"defaults": {
|
|
"description": "Default values to be added to all requests.",
|
|
"$ref": "#/definitions/requestObject"
|
|
},
|
|
"plugins": {
|
|
"description": "Plugins to be enabled for this document.",
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{ "type": "string" },
|
|
{ "type": "object", "additionalProperties": true }
|
|
]
|
|
}
|
|
},
|
|
"environment": {
|
|
"type": "object",
|
|
"description": "Global document variables for easy access.",
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"_": {
|
|
"type": "object",
|
|
"description": "Environment variables brought in by cli params or dotenv.",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patternProperties": {
|
|
"(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\\s.*": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/request"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/request"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|