Api-blueprint: Support Multiple HTTP Headers

Created on 26 Jul 2016  ·  3Comments  ·  Source: apiaryio/api-blueprint

It seems that API Blueprint doesn't allow for multiple HTTP headers.

According to ye olde RFC 2616 it is possible to have multiple HTTP headers. RFC 7230 makes it clearer:

   A sender MUST NOT generate multiple header fields with the same field
   name in a message unless either the entire field value for that
   header field is defined as a comma-separated list [i.e., #(values)]
   or the header field is a well-known exception (as noted below).

Things like the Prefer and Link headers are often presented on individual lines for legibility.

API Blueprint currently requires that you present them on a single line as a comma separated list (which is fine enough), but making it more legible by allowing them to be written on separate lines, would be ideal.

Thanks!
:tophat:

Language Confirmed Bug

All 3 comments

For completeness, the Set-Cookie and Link header are "tolerated" by parser. Question is whether:

  1. Keep the white list of header that can appear multiple times
  2. Remove this warning completely

Seems like me and @BigBlueHat are up for removing the warning altogether...

Notes on current implementation https://github.com/apiaryio/snowcrash/issues/75#issuecomment-58886108

Removing the warning has the advantage of allowing people to create their own custom headers which could potentially be defined as having comma separated list values. Hard to know the future, so "be liberal in what you accept from others." :smile:

Was this page helpful?
0 / 5 - 0 ratings