tgscraper/docs/schema.json

131 lines
2.5 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Schema for TGScraper custom Bot API format",
"description": "This schema should help you understanding the custom format used by TGScraper.",
"type": "object",
"required": [
"version",
"methods",
"types"
],
"properties": {
"version": {
"type": "string"
},
"methods": {
"type": "array",
"items": {
"$ref": "#/definitions/Method"
}
},
"types": {
"type": "array",
"items": {
"$ref": "#/definitions/Type"
}
}
},
"definitions": {
"Method": {
"type": "object",
"required": [
"name",
"description",
"fields",
"return_types"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/Field"
}
},
"return_types": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"Field": {
"type": "object",
"required": [
"name",
"types",
"optional",
"description",
"default"
],
"properties": {
"name": {
"type": "string"
},
"types": {
"type": "array",
"items": {
"type": "string"
}
},
"optional": {
"type": "boolean"
},
"description": {
"type": "string"
},
"default": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "integer"
},
{
"type": "object"
},
{
"type": "string"
}
]
}
}
},
"Type": {
"type": "object",
"required": [
"name",
"description",
"fields",
"extended_by"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/Field"
}
},
"extended_by": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}