From b93a24d94900931dce22226854ee3c5656bbeb7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 5 Jan 2025 10:36:04 +0100 Subject: [PATCH] relay/api: fix name of body field "buffer_name" in doc of POST /api/input --- doc/en/weechat_relay_api.en.adoc | 4 ++-- doc/fr/weechat_relay_api.fr.adoc | 4 ++-- src/plugins/relay/api/relay-api-protocol.c | 6 +++--- src/plugins/relay/api/weechat-relay-api.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/en/weechat_relay_api.en.adoc b/doc/en/weechat_relay_api.en.adoc index fa742fbe0..310a41eca 100644 --- a/doc/en/weechat_relay_api.en.adoc +++ b/doc/en/weechat_relay_api.en.adoc @@ -1184,7 +1184,7 @@ Body parameters: * `buffer_id` (integer, optional): buffer unique identifier (not to be confused with the buffer number, which is different) -* `buffer` (string, optional, default: `core.weechat`): buffer name +* `buffer_name` (string, optional, default: `core.weechat`): buffer name * `command` (string, **required**): command or text to send to the buffer Request example: say "hello!" on channel #weechat: @@ -1192,7 +1192,7 @@ Request example: say "hello!" on channel #weechat: [source,shell] ---- curl -L -u 'plain:secret_password' -X POST \ - -d '{"buffer": "irc.libera.#weechat", "command": "hello!"}' \ + -d '{"buffer_name": "irc.libera.#weechat", "command": "hello!"}' \ 'https://localhost:9000/api/input' ---- diff --git a/doc/fr/weechat_relay_api.fr.adoc b/doc/fr/weechat_relay_api.fr.adoc index 6f8225620..7b9b045c0 100644 --- a/doc/fr/weechat_relay_api.fr.adoc +++ b/doc/fr/weechat_relay_api.fr.adoc @@ -1196,7 +1196,7 @@ Paramètres du corps : * `buffer_id` (entier, facultatif) : identifiant unique du tampon (à ne pas confondre avec le numéro du tampon, qui est différent) -* `buffer_name` (chaîne, facultatif) : nom de tampon +* `buffer_name` (chaîne, facultatif, par défaut : `core.weechat`) : nom de tampon * `command` (chaîne, **obligatoire**) : commande ou texte à envoyer au tampon Exemple de requête : dire "hello!" sur le canal #weechat : @@ -1204,7 +1204,7 @@ Exemple de requête : dire "hello!" sur le canal #weechat : [source,shell] ---- curl -L -u 'plain:secret_password' -X POST \ - -d '{"buffer": "irc.libera.#weechat", "command": "hello!"}' \ + -d '{"buffer_name": "irc.libera.#weechat", "command": "hello!"}' \ 'https://localhost:9000/api/input' ---- diff --git a/src/plugins/relay/api/relay-api-protocol.c b/src/plugins/relay/api/relay-api-protocol.c index db360eab7..10fe0d501 100644 --- a/src/plugins/relay/api/relay-api-protocol.c +++ b/src/plugins/relay/api/relay-api-protocol.c @@ -994,7 +994,7 @@ error: * { * "request": "POST /api/input", * "body": { - * "buffer": "irc.libera.#weechat", + * "buffer_name": "irc.libera.#weechat", * "command": "hello!" * } * } @@ -1002,10 +1002,10 @@ error: * It is converted to an HTTP request which could have been: * * POST /api/input HTTP/1.1 - * Content-Length: 53 + * Content-Length: 58 * Content-Type: application/json * - * {"buffer": "irc.libera.#weechat","command": "hello!"} + * {"buffer_name": "irc.libera.#weechat","command": "hello!"} * * The JSON can also be an array of requests, for example to fetch all buffers * data and synchronize at same time: diff --git a/src/plugins/relay/api/weechat-relay-api.yaml b/src/plugins/relay/api/weechat-relay-api.yaml index 07a4ebbc7..e9dd56972 100644 --- a/src/plugins/relay/api/weechat-relay-api.yaml +++ b/src/plugins/relay/api/weechat-relay-api.yaml @@ -991,7 +991,7 @@ components: format: int64 description: Buffer identifier (≥ 0) example: 1709932823238637 - buffer: + buffer_name: type: string description: >- Buffer full name