Adds a README to the command JSON files (#13066)
Add readme about the command json folder, what it does, and who should (not) use it. see discussion https://github.com/redis/redis/issues/9359#issuecomment-1936420698 --------- Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
8876d264ac
commit
6df42df291
15
src/commands/README.md
Normal file
15
src/commands/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
This directory contains JSON files, one for each of Redis commands.
|
||||
|
||||
Each JSON contains all the information about the command itself, but these JSON files are not to be used directly!
|
||||
Any third party who needs access to command information must get it from `COMMAND INFO` and `COMMAND DOCS`.
|
||||
The output can be extracted in a JSON format by using `redis-cli --json`, in the same manner as in `utils/generate-commands-json.py`.
|
||||
|
||||
The JSON files are used to generate commands.def (and https://github.com/redis/redis-doc/blob/master/commands.json) in Redis, and
|
||||
despite looking similar to the output of `COMMAND` there are some fields and flags that are implicitly populated, and that's the
|
||||
reason one shouldn't rely on the raw files.
|
||||
|
||||
The structure of each JSON is somewhat documented in https://redis.io/commands/command-docs/ and https://redis.io/commands/command/
|
||||
|
||||
The `reply_schema` section is a standard JSON Schema (see https://json-schema.org/) that describes the reply of each command.
|
||||
It is designed to someday be used to auto-generate code in client libraries, but is not yet mature and is not exposed externally.
|
||||
|
Loading…
x
Reference in New Issue
Block a user