stoplightio / elements

Build beautiful, interactive API Docs with embeddable React or Web Components, powered by OpenAPI and Markdown.
https://stoplight.io/open-source/elements/
Apache License 2.0
1.6k stars 189 forks source link

fix(elements-core): Do not omit request body for certain HTTP methods #2607

Open provokateurin opened 2 days ago

provokateurin commented 2 days ago

The HTTP spec does not forbid using request bodies for GET, DELETE and other methods (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET for example). OpenAPI doesn't forbid this either, so it is possible to have a valid specification that is not correctly executed by this library.

I'm not sure about adding tests, as I couldn't find any tests that cover this area of the code so far, or at least not directly unit testing this method. Let me know if you want to have tests for this change and how I can implement them best.

netlify[bot] commented 2 days ago

Deploy Preview for stoplight-elements ready!

Name Link
Latest commit ecc4e9fa37107e40724807a454d4e49b2b2c4e32
Latest deploy log https://app.netlify.com/sites/stoplight-elements/deploys/6682634747aac30008d16ffe
Deploy Preview https://deploy-preview-2607--stoplight-elements.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 2 days ago

Deploy Preview for stoplight-elements-demo ready!

Name Link
Latest commit ecc4e9fa37107e40724807a454d4e49b2b2c4e32
Latest deploy log https://app.netlify.com/sites/stoplight-elements-demo/deploys/668263472574070008418053
Deploy Preview https://deploy-preview-2607--stoplight-elements-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.