drafter
drafter copied to clipboard
Snowcrash should warn when blueprint specifies Request with GET method
@Almad opened apiaryio/snowcrash#64
With GET
, there should be no request body.
When it's specified in blueprint, snowcrash should warn or err.
@zdne commented
@Almad
Specifying a request HTTP message body for a GET request does not violate HTTP1.1. See here and also here.
Also Fielding's comment seems to be spot on. Personally I know of at least one API (GitHub) that does process HTTP request message body even with the GET method (auth token sent in request message body).
Since this is not a violation of the HTTP spec and it is occasionally used I would vote for not introducing this behavior.
@Almad commented
@zdne Hmm.
So, yes, you can send a body with GET, and no, it is never useful to do so.
That's why I'd vote for warning. I believe most people add this by mistake and not intentionally...and those who do can get non-harmful warnings.
But we may leave this open.
@zdne commented
non-harmful warnings
Regarding warnings I have learned that there are generally two groups of people: Those who don't care about them at all and those who take even the smallest warning very seriously. The later group seems to be a lot bigger (read: louder).
@pksunkara commented
I am against adding a warning as long as it's not violating HTTP spec. @zdne Please decide if we are going to tag this as improvement or close this issue.
@zdne commented
I guess that some sort of "HTTP module" with its own HTTP-warnings (see apiaryio/snowcrash#51) should be introduced and possible capture this situation.
I would certainly not add this as a current parser's warning.