The current commands.json doesn't support the special NO ONE argument mentioned in the document.
https://github.com/redis/redis-doc/blob/529616854125ddc227dc4edef1a7b195f06b2935/commands.json#L11063-L11092
Is it okay to just change the type of the port field to string? By doing that the ONE argument can fit into the port field.
Comment From: itamarhaber
Hi @rueian
The commands.json file is generated (using utils/generate-command-code.py) from the src/commands/*.json files in the redis/redis repository.
Hence, fixes should go there :) Moving this to the proper repo to continue the discussion.
Comment From: enjoy-binbin
@guybe7 do you think this will work?
"arguments": [
{
"name": "args",
"type": "oneof",
"arguments": [
{
"name": "host-port",
"type": "block",
"arguments": [
{
"name": "host",
"type": "string"
},
{
"name": "port",
"type": "integer"
}
]
},
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "string"
},
{
"name": "one",
"type": "string"
}
]
}
]
}
],
Comment From: guybe7
@enjoy-binbin
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "pure-token",
"token": "NO"
},
{
"name": "one",
"type": "pure-token",
"token": "ONE"
}
]
}
Comment From: madolson
Is it okay to just change the type of the port field to string? By doing that the ONE argument can fit into the port field.
I like this suggestion more. It seems much simpler.