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

Try-it: Content-type added even when no request body defined #2351

Closed
mnaumanali94 opened this issue Apr 4, 2023 · 4 comments
Closed

Try-it: Content-type added even when no request body defined #2351

mnaumanali94 opened this issue Apr 4, 2023 · 4 comments
Assignees
Labels

Comments

@mnaumanali94
Copy link
Contributor

Context

The bug affects users of Elements with endpoints without a request body. When making a request without a request body defined, elements adds a "content-type: application/json" header. This causes Prism to fail in the proxy-mode.

Current Behavior

Stoplight adds a "content-type: application/json" header on requests that don't have a request body defined.

Expected Behavior

No "content-type" header should be added if there's no request body defined. Elements should only add the "content-type" header if a request body is present.

Steps to Reproduce

  1. Create a new OpenAPI file in Stoplight Studio with a GET endpoint without a request body.
  2. Publish the OpenAPI file.
  3. Go to the "Try It" section and view the request sample.
  4. Observe that the "content-type: application/json" header is present, even though there is no request body defined.
@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."

@shartman2003
Copy link

@mnaumanali94 SPS Commerce is asking for a timeline on this issue. This is a high priority for them, it is holding up a release of theirs. Can we get this in the next sprint?

@mnaumanali94
Copy link
Contributor Author

@shartman2003 We can get this in the next sprint 🙏🏼

@travisgosselin
Copy link

@shartman2003 We can get this in the next sprint 🙏🏼

Much appreciated!

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

No branches or pull requests

4 participants