IBM/openapi-validator

no_response_body exclusion for OPTIONS requests

Closed this issue ยท 4 comments

General convention for OPTIONS requests is to return an empty 200 response with Content-Length=0.

Doing some investigation, some builds of FireFox even flag preflight requests that return anything other than 200 as an error (not sure on the behavior for the current release).

The no_response_body rule should either ignore empty response bodies for OPTIONS requests or allow configuration to exclude them.

Looking into it, it seems like it's a common enough pattern to disable this rule for OPTIONS requests. I think I prefer that to allowing general configuration for turning this rule off. @mkistler @hudlow any opinions here?

If we agree that's the best way forward, @timtucker would you be willing to open a PR for that change? If not, I will try to get to it soon.

Skipping that check for OPTIONS sounds very reasonable to me. I don't think a configuration setting is needed.

๐ŸŽ‰ This issue has been resolved in version 0.33.2 ๐ŸŽ‰

The release is available on npm package (@latest dist-tag)

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 0.84.2 ๐ŸŽ‰

The release is available on npm package (@latest dist-tag)

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€