{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"url": {
"type": "string",
"title": "Url"
},
"method": {
"type": "string",
"title": "Method",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]
},
"content-type": {
"type": "string",
"title": "Content Type",
"enum": ["text", "html", "json", "binary", "urlencoded", "form-data", "image", "video", "audio"],
"default": "json",
"ui": {
"options": [
{ "value": "text", "label": "Text" },
{ "value": "html", "label": "HTML" },
{ "value": "json", "label": "JSON" },
{ "value": "binary", "label": "Binary" },
{ "value": "urlencoded", "label": "URL Encoded" },
{ "value": "form-data", "label": "Form Data" },
{ "value": "image", "label": "Image" },
{ "value": "video", "label": "Video" },
{ "value": "audio", "label": "Audio" }
]
}
},
"headers": {
"type": "array",
"title": "Headers",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"value": { "type": "string" }
},
"required": ["key", "value"]
}
},
"params": {
"type": "array",
"title": "Params",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"value": { "type": "string" }
},
"required": ["key", "value"]
}
},
"timeout-ms": {
"type": "integer",
"title": "Timeout (ms)",
"minimum": 1,
"maximum": 3600000,
"description": "Total request timeout for this act, in milliseconds. An act may only tighten the server's [http].timeout-ms, never widen it; leave empty to use the configured bound."
}
},
"dependencies": {
"content-type": {
"oneOf": [
{
"properties": {
"content-type": { "const": "json" },
"body": { "type": "object" }
},
"required": ["body"]
},
{
"properties": {
"content-type": { "enum": ["text", "html"] },
"body": { "type": "string" }
},
"required": ["body"]
},
{
"properties": {
"content-type": { "enum": ["urlencoded", "form-data"] },
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"value": { "type": "string" }
},
"required": ["key", "value"]
}
}
},
"required": ["body"]
},
{
"properties": {
"content-type": { "enum": ["image", "video", "audio", "binary"] },
"body": { "type": "string" }
},
"required": ["body"]
},
{
"properties": {
"body": { "type": "null" }
}
}
]
}
},
"required": ["url", "method", "content-type"]
}