core-lightning/doc/schemas/lightning-disconnect.json
Rusty Russell b327bd30c3 doc: fix all JSON schemas to enforce no additional properties.
Without this, we have hardly any enforcement.  This is why the schema
mistake fixed in the previous patches weren't spotted immediately.

The hard work was done by:

```
$ for f in lightning-*.json; do grep -v '^  "additionalProperties": false,' $f | bagto $f; done
$ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done
$ make fmt-schemas
```

Then checking where 'additionalProperties: true' had been turned to
false (we deliberately use it in some places where there are if
statements in the schema, or occasionally where there can be arbitrary
fields).

[Including doc/rpc-schema-draft.json update by Shahana]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-10-30 15:39:12 +10:30

73 lines
1.9 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "disconnect",
"title": "Command for disconnecting from another lightning node",
"description": [
"The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel."
],
"request": {
"required": [
"id"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "pubkey",
"description": [
"The public key of the peer to terminate the connection. It can be discovered as peer_id in the output of the listpeerchannels command."
]
},
"force": {
"type": "boolean",
"description": [
"If set to True, it will disconnect even with an active channel."
]
}
}
},
"response": {
"additionalProperties": false,
"properties": {}
},
"errors": [
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
"",
"- -32602: If the given parameters are wrong.",
"- -1: Catchall nonspecific error."
],
"author": [
"Michael Hawkins <<michael.hawkins@protonmail.com>>."
],
"see_also": [
"lightning-connect(7)",
"lightning-listpeerchannels(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:disconnect#1",
"method": "disconnect",
"params": {
"id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
"force": false
}
},
"response": {}
},
{
"request": {
"id": "example:disconnect#2",
"method": "disconnect",
"params": {
"id": "032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e",
"force": true
}
},
"response": {}
}
]
}