Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
414owen opened this issue Jan 21, 2024 · 0 comments
Open

Comments

@414owen
Copy link

414owen commented Jan 21, 2024

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>...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant