core-lightning/doc/schemas/lightning-help.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

106 lines
2.6 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "help",
"title": "Command to return all information about RPC commands.",
"description": [
"The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.",
"",
"Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found."
],
"request": {
"required": [],
"additionalProperties": false,
"properties": {
"command": {
"type": "string",
"description": [
"Command to get information about."
]
}
}
},
"response": {
"required": [
"help"
],
"additionalProperties": false,
"properties": {
"help": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"required": [
"command"
],
"properties": {
"command": {
"type": "string",
"description": [
"The command."
]
}
}
}
},
"format-hint": {
"type": "string",
"enum": [
"simple"
],
"description": [
"Prints the help in human-readable flat form."
]
}
}
},
"errors": [
"On failure, one of the following error codes may be returned:",
"",
"- -32602: Error in given parameters."
],
"author": [
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
"but many others did the hard work of actually implementing this rpc command."
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:help#1",
"method": "help",
"params": {
"command": "pay"
}
},
"response": {
"help": [
{
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [partial_msat] [dev_use_shadow]"
}
],
"format-hint": "simple"
}
},
{
"request": {
"id": "example:help#2",
"method": "help",
"params": {
"command": "dev"
}
},
"response": {
"help": [
{
"command": "dev subcommand=crash|rhash|slowcmd"
}
],
"format-hint": "simple"
}
}
]
}