Skip to content

Add detailed RESP3 command responses #2512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
oranagra opened this issue Aug 10, 2023 · 1 comment
Open

Add detailed RESP3 command responses #2512

oranagra opened this issue Aug 10, 2023 · 1 comment

Comments

@oranagra
Copy link
Member

oranagra commented Aug 10, 2023

It would be a good idea to:

  1. use the data from the reply schema we now maintain in redis (see Add reply_schema to command json files (internal for now) redis#10273) in order to add detailed description on the reply format of each command (includes comments about RESP2 when non trivial).
  2. consider adding details about breaking changes in command replies such as Change return value type for ZPOPMAX/MIN in RESP3 redis#8981 (can be found by grepping for "breaking" and "behavior" in the release notes of all recent releases.

see discussion in redis/redis#12466

@zuiderkwast
Copy link
Contributor

zuiderkwast commented Mar 4, 2024

It seems that we now have "RESP2/RESP3 Reply" for each command.

However, for commands returning a set, it's documented as an array, which is just very wrong in any language where a set is not the same thing as an array. For SMEMBERS it says

RESP2/RESP3 Reply

Array reply: all members of the set.

I guess this is based on the reply JSON-schema redis/redis#10273, but since there are no sets in JSON, it doesn't distinguish between a set and an array. The schema for SMEMBERS says

    "reply_schema": {
        "type": "array",
        "description": "All elements of the set.",
        "uniqueItems": true,
        "items": {
            "type": "string"
        }
    },

Would it be safe to use this "uniqueItems" field to indicate that it's actually a set? @guybe7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants