Skip to content

RESP3: Suggest whether clients should parse verbatim string format tags #25

@414owen

Description

@414owen

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>...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions