Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prism should not error due to extra content-type header #2255

Closed
ryotrellim opened this issue Apr 4, 2023 · 3 comments
Closed

Prism should not error due to extra content-type header #2255

ryotrellim opened this issue Apr 4, 2023 · 3 comments

Comments

@ryotrellim
Copy link
Contributor

ryotrellim commented Apr 4, 2023

Context

SPS Commerce has reached out to us with this ask:
"We are the process of rolling out Prism in proxy mode to validate our APIs specs in services, in logging mode to evaluate traffic.
That is working quite well, except one MAJOR issue related to the stoplight platform functionality for “Send API Requests”.

Specifically, with the Prism Proxy in place with a command such as:
prism proxy design/v4.oas.yml http://localhost:5000/

If I then make a curl request to the service (notice I’ve included content-type for this GET request):

curl --request GET \
 --url '[http://localhost:4010/examples`](http://localhost:4010/examples) --header 'Content-Type: application/json'

This will fail on the Prism side as follows:

{
    "type": "TypeError",
    "title": "Request with GET/HEAD method cannot have body",
    "status": 500,
    "detail": ""
}

Expected Outcome:

  1. Prism ignores content-type header if no request body
@shartman2003
Copy link

Got this from SPS Commerce: "Our teams are well integrated with Stoplight for sending requests to our API, and so rolling out Prism in front of it has been halted for the time being until we can fix either the Prism side or the Stoplight side."

@ryotrellim
Copy link
Contributor Author

Corresponding upstream UI issue: stoplightio/elements#2351

@travisgosselin
Copy link

Between this noted issue and the issue in stoplight elements (stoplightio/elements#2351), it makes it pretty much impossible to use Prism alongside elements in the same API. Glad to see a priority of high on this issue given the impact of how this can break Prism even in log mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants