From 072898399523843e4abb6c50e9e9a2ac1935910e Mon Sep 17 00:00:00 2001 From: heyone-top <979034501@qq.com> Date: Wed, 22 Nov 2023 20:27:53 +0800 Subject: [PATCH] Correction of map representation in RESP2 (#2587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the protocol spec, the description of how maps are represented in RESP2 is incorrect. "Maps in RESP2 are represented by arrays, in which each element is a key-value tuple. Each tuple is an array with two elements, these being the key and the value." This is not true. A map in RESP2 is represented as a flat array containing the keys and values, not nested arrays. The description is updated. Co-authored-by: Viktor Söderqvist --- docs/reference/protocol-spec.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference/protocol-spec.md b/docs/reference/protocol-spec.md index a9893c8a5b..c5ace66fd8 100644 --- a/docs/reference/protocol-spec.md +++ b/docs/reference/protocol-spec.md @@ -516,8 +516,9 @@ However, low-level programming languages (such as C, for example) will likely re {{% alert title="Map pattern in RESP2" color="info" %}} RESP2 doesn't have a map type. -Maps in RESP2 are represented by arrays, in which each element is a key-value tuple. -Each tuple is an array with two elements, these being the key and the value. +A map in RESP2 is represented by a flat array containing the keys and the values. +The first element is a key, followed by the corresponding value, then the next key and so on, like this: +`key1, value1, key2, value2, ...`. {{% /alert %}}