Unverified Commit 223046ec authored by guybe7's avatar guybe7 Committed by GitHub
Browse files

Repurpose redisCommandArg's name as the unique ID (#11051)

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_text" 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). 
parent fc3956e8
This diff is collapsed.
......@@ -45,7 +45,7 @@
"key_spec_index": 0
},
{
"name": "index",
"name": "range",
"type": "block",
"optional": true,
"arguments": [
......@@ -58,7 +58,7 @@
"type": "integer"
},
{
"name": "index_unit",
"name": "unit",
"type": "oneof",
"optional": true,
"since": "7.0.0",
......
......@@ -50,7 +50,7 @@
"arguments": [
{
"token": "GET",
"name": "encoding_offset",
"name": "get-block",
"type": "block",
"arguments": [
{
......@@ -69,7 +69,7 @@
"arguments": [
{
"token": "OVERFLOW",
"name": "wrap_sat_fail",
"name": "overflow-block",
"type": "oneof",
"optional": true,
"arguments": [
......@@ -91,12 +91,12 @@
]
},
{
"name": "write_operation",
"name": "write-operation",
"type": "oneof",
"arguments": [
{
"token": "SET",
"name": "encoding_offset_value",
"name": "set-block",
"type": "block",
"arguments": [
{
......@@ -115,7 +115,7 @@
},
{
"token": "INCRBY",
"name": "encoding_offset_increment",
"name": "incrby-block",
"type": "block",
"arguments": [
{
......@@ -140,4 +140,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -41,7 +41,7 @@
},
{
"token": "GET",
"name": "encoding_offset",
"name": "get-block",
"type": "block",
"multiple": true,
"multiple_token": true,
......
......@@ -49,7 +49,7 @@
"type": "integer"
},
{
"name": "index",
"name": "range",
"type": "block",
"optional": true,
"arguments": [
......@@ -58,7 +58,7 @@
"type": "integer"
},
{
"name": "end_index",
"name": "end-unit-block",
"type": "block",
"optional": true,
"arguments": [
......@@ -67,7 +67,7 @@
"type": "integer"
},
{
"name": "index_unit",
"name": "unit",
"type": "oneof",
"optional": true,
"since": "7.0.0",
......
......@@ -45,7 +45,8 @@
"type": "oneof",
"arguments": [
{
"name": "ip:port",
"name": "old-format",
"display": "ip:port",
"type": "string",
"deprecated_since": "2.8.12"
},
......@@ -63,7 +64,7 @@
},
{
"token": "TYPE",
"name": "normal_master_slave_pubsub",
"name": "client-type",
"type": "oneof",
"optional": true,
"since": "2.8.12",
......@@ -105,20 +106,23 @@
},
{
"token": "ADDR",
"name": "ip:port",
"name": "addr",
"display": "ip:port",
"type": "string",
"optional": true
},
{
"token": "LADDR",
"name": "ip:port",
"name": "laddr",
"display": "ip:port",
"type": "string",
"optional": true,
"since": "6.2.0"
},
{
"token": "SKIPME",
"name": "yes/no",
"name": "skipme",
"display": "yes/no",
"type": "string",
"optional": true
}
......
......@@ -37,7 +37,7 @@
"arguments": [
{
"token": "TYPE",
"name": "normal_master_replica_pubsub",
"name": "client-type",
"type": "oneof",
"optional": true,
"since": "5.0.0",
......@@ -65,18 +65,12 @@
]
},
{
"name": "id",
"name": "client-id",
"token": "ID",
"type": "block",
"type": "integer",
"optional": true,
"since": "6.2.0",
"arguments": [
{
"name": "client-id",
"type": "integer",
"multiple": true
}
]
"multiple": true,
"since": "6.2.0"
}
]
}
......
......@@ -18,7 +18,7 @@
],
"arguments": [
{
"name": "on_off_skip",
"name": "action",
"type": "oneof",
"arguments": [
{
......
......@@ -23,7 +23,7 @@
"type": "integer"
},
{
"name": "timeout_error",
"name": "unblock-type",
"type": "oneof",
"optional": true,
"arguments": [
......
......@@ -17,7 +17,7 @@
],
"arguments": [
{
"name": "start-slot_end-slot",
"name": "range",
"type": "block",
"multiple": true,
"arguments": [
......
......@@ -17,7 +17,7 @@
],
"arguments": [
{
"name": "start-slot_end-slot",
"name": "range",
"type": "block",
"multiple": true,
"arguments": [
......
......@@ -31,7 +31,7 @@
"type": "integer"
},
{
"name": "cluster_bus_port",
"name": "cluster-bus-port",
"type": "integer",
"optional": true,
"since": "4.0.0"
......
......@@ -17,7 +17,7 @@
],
"arguments": [
{
"name": "hard_soft",
"name": "reset-type",
"type": "oneof",
"optional": true,
"arguments": [
......
......@@ -25,17 +25,20 @@
"type": "oneof",
"arguments": [
{
"name": "node-id",
"name": "importing",
"display": "node-id",
"type": "string",
"token": "IMPORTING"
},
{
"name": "node-id",
"name": "migrating",
"display": "node-id",
"type": "string",
"token": "MIGRATING"
},
{
"name": "node-id",
"name": "node",
"display": "node-id",
"type": "string",
"token": "NODE"
},
......
......@@ -22,14 +22,8 @@
"arguments": [
{
"name": "parameter",
"type": "block",
"multiple": true,
"arguments": [
{
"name": "parameter",
"type": "string"
}
]
"type": "string",
"multiple": true
}
]
}
......
......@@ -25,7 +25,7 @@
],
"arguments": [
{
"name": "parameter_value",
"name": "data",
"type": "block",
"multiple": true,
"arguments": [
......
......@@ -29,7 +29,7 @@
],
"arguments": [
{
"name": "async",
"name": "flush-type",
"type": "oneof",
"optional": true,
"arguments": [
......
......@@ -29,7 +29,7 @@
],
"arguments": [
{
"name": "async",
"name": "flush-type",
"type": "oneof",
"optional": true,
"arguments": [
......
......@@ -20,7 +20,7 @@
],
"arguments": [
{
"name": "async",
"name": "flush-type",
"type": "oneof",
"optional": true,
"arguments": [
......
......@@ -71,7 +71,7 @@
"since": "6.2.0"
},
{
"name": "longitude_latitude_member",
"name": "data",
"type": "block",
"multiple": true,
"arguments": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment