redis-specifications
redis-specifications copied to clipboard
RESP3: Suggest whether clients should parse verbatim string format tags
For the Verbatim string
=15<CR><LF>
txt:Some string<CR><LF>
Should the client return "Some String"
, or "txt:Some string"
?
I would suggest the former, and I would also suggest that the caller be informed which tag was parsed. When writing the type of a response (in Haskell syntax), this would amount to:
data RespResponse
= VerbatimString Text
| VerbatimMarkdown Text
| ...<other response variants>...
The spec states that:
Moreover the first three bytes provide information about the format of the following string, which can be txt for plain text, or mkd for markdown
Am I right in thinking that these two formats are locked in as the only formats that can be returned?
If so, I suggest changing the above to
Moreover the first three bytes provide information about the format of the following string, which can either be txt for plain text, or mkd for markdown, and cannot be anything else.
Without this change, a cautious interpretation would force clients to adopt this (less specific) representation:
data RespResponse
= Verbatim {tag :: ByteString, data :: ByteString}
| ...<other response variants>...