redis icon indicating copy to clipboard operation
redis copied to clipboard

Repurpose redisCommandArg's name as the unique ID

Open guybe7 opened this issue 3 years ago • 2 comments

Partial fix of #10948

This PR makes sure that "name" is unique for all arguments in the same level (i.e. all args of a command and all args within a block/oneof). This means several argument with identical meaning can be referred to together, but also if someone needs to refer to a specific one, they can use its full path.

In addition, the "display" field has been added, to be used by redis.io in order to render the syntax of the command (for the vast majority it is identical to "name" but sometimes we want to use a different string that is not "name") The "display" field is exposed via COMMAND DOCS and will be present for every argument, except "oneof" and "block" (which are container arguments)

Other changes:

  1. Make sure we do not have any container arguments ("oneof" or "block") that contain less than two sub-args (otherwise it doesn't make sense)
  2. migrate.json: both AUTH and AUTH2 should not be "optional"
  3. arg names cannot contain underscores, and force the usage of hyphens (most of these were a result of the script that generated the initial json files from redis.io commands.json).
  • [x] go over all "name"s: make sure they make sense because soon we won't be able to modify them (people may rely on their value)
  • [x] validate no underscore in "name"

guybe7 avatar Jul 27 '22 15:07 guybe7

I'm good with this.

itamarhaber avatar Aug 14 '22 21:08 itamarhaber

@redis/core-team please approve, adds a "display" field for command arguments in COMMAND DOCS output. more details at the top.

oranagra avatar Aug 15 '22 05:08 oranagra

@guybe7 please make a PR to update the docs of COMMAND DOCS, and also coordinate with @itamarhaber what should be done in order for redis.io to render the new display_text field.

oranagra avatar Aug 18 '22 12:08 oranagra

Merged website support for new display field... now we just need the new commands.json :)

itamarhaber avatar Aug 18 '22 14:08 itamarhaber

https://github.com/redis/redis-doc/pull/2091

guybe7 avatar Aug 19 '22 14:08 guybe7