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

65 lines
1.7 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"added": "v24.02",
"rpc": "deprecations",
"title": "Command to enable/disable deprecated APIs",
"description": [
"The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features."
],
"request": {
"required": [
"enable"
],
"additionalProperties": false,
"properties": {
"enable": {
"type": "boolean",
"description": [
"Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields."
]
}
}
},
"response": {
"additionalProperties": false,
"properties": {}
},
"errors": [
"On failure, one of the following error codes may be returned:",
"",
"- -32602: Error in given parameters."
],
"author": [
"Rusty Russell <<rusty@blockstream.com>> wrote the initial version of this man page."
],
"see_also": [
"lightningd-config(5)",
"lightning-notifications(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:deprecations#1",
"method": "deprecations",
"params": {
"enable": true
}
},
"response": {}
},
{
"request": {
"id": "example:deprecations#2",
"method": "deprecations",
"params": {
"enable": false
}
},
"response": {}
}
]
}