API Blueprint 似乎不允许多个 HTTP 标头。
根据RFC 2616 ,可以有多个 HTTP 标头。 RFC 7230使它更清楚:
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).
诸如Prefer
和Link
标题之类的内容通常显示在单独的行上以提高可读性。
API Blueprint 目前要求您将它们作为逗号分隔的列表显示在一行中(这已经足够了),但是通过允许它们写在单独的行上使其更易读是理想的。
谢谢!
: 礼帽:
为完整起见,解析器“容忍” Set-Cookie
和Link
标头。 问题是:
似乎我和@BigBlueHat准备完全消除警告......
当前实施注意事项https://github.com/apiaryio/snowcrash/issues/75#issuecomment -58886108
删除警告的优点是允许人们创建自己的自定义标题,这些标题可能被定义为具有逗号分隔的列表值。 很难知道未来,所以“对你从别人那里接受的东西要宽容。” :微笑: