redis-doc
redis-doc copied to clipboard
ZRANGEBYSCORE min/max argument types not complete
In commands.json, ZRANGEBYSCORE has its min and max arguments as double: https://github.com/redis/redis-doc/blob/e978cf5875a257ba4a3389abfa844a23df28c0f0/commands.json#L3806-L3813
But the value is also allowed to be +inf, -inf, (1 etc.
Likewise with ZREMRANGEBYSCORE, ZREVRANGEBYSCORE and ZCOUNT.
It'd be great if commands.json could somehow indicate that more than just double is allowed.
Note that https://github.com/redis/redis-doc/pull/1232 would solve this problem with no extra effort, because this is already possible to express precisely with json schema:
name: min
schema:
anyOf:
- type: number
- type: string
enum: [-inf, +inf]
- type: string
pattern: ^\(\d+(\.\d+)?$
json equivalent
{
"name": "min",
"schema": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"-inf",
"+inf"
]
},
{
"type": "string",
"pattern": "^\\(\\d+(\\.\\d+)?$"
}
]
}
}
Related: https://github.com/mmkal/handy-redis/issues/30
I think the issue is resolved in this pull request (https://github.com/mmkal/handy-redis/pull/240). This issue can be closed
That's just a workaround in a downstream library. The issue is that commands.json in this repo reports an incomplete type for the min/max arguments, and that's still the case, so it shouldn't be closed.