core-lightning/doc/schemas/connect.schema.json
Vincenzo Palazzo bd3c0ef85c jsonschema: Formatting json schema and regenerate docs
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30

111 lines
2.5 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"features",
"direction",
"address"
],
"properties": {
"id": {
"type": "pubkey",
"description": "the peer we connected to"
},
"features": {
"type": "hex",
"description": "BOLT 9 features bitmap offered by peer"
},
"direction": {
"type": "string",
"enum": [
"in",
"out"
],
"description": "Whether they initiated connection or we did"
},
"address": {
"type": "object",
"description": "Address information (mainly useful if **direction** is *out*)",
"additionalProperties": true,
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"local socket",
"ipv4",
"ipv6",
"torv2",
"torv3"
],
"description": "Type of connection (*torv2*/*torv3* only if **direction** is *out*)"
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"type": "string",
"enum": [
"local socket"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"socket"
],
"properties": {
"type": {},
"socket": {
"type": "string",
"description": "socket filename"
}
}
}
},
{
"if": {
"properties": {
"type": {
"type": "string",
"enum": [
"ipv4",
"ipv6",
"torv2",
"torv3"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"address",
"port"
],
"properties": {
"type": {},
"address": {
"type": "string",
"description": "address in expected format for **type**"
},
"port": {
"type": "u16",
"description": "port number"
}
}
}
}
]
}
}
}