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

Form data request are going without fields #2628

Open
Yashaswi-1998 opened this issue Jul 30, 2024 · 0 comments
Open

Form data request are going without fields #2628

Yashaswi-1998 opened this issue Jul 30, 2024 · 0 comments
Labels
p/medium t/bug Something isn't working triaged

Comments

@Yashaswi-1998
Copy link

There is an Upload API in this openApi spec which uses multipart/form-data to send the request. On using the stoplight demo project when I try to send a request through this API no fields are being attached in the request payload which can be clearly seen in the network tab under inspect panel of the browser.
This is the link to the stoplight demo https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/Yashaswi-1998/OpenApi/main/Imagekit.yaml#/operations/upload-file

Context

Users are not able to use the API even after entering correct details. The API errors out, confusing the users.

Current Behavior

Currently the API errors out with below message. This is happening because fileName field is not getting attached in form data.

{
    "message": "Your request is missing fileName parameter.",
    "help": "For support kindly contact us at [email protected] ."
}

Expected Behavior

It should upload the file and give 201 status code.

Possible Workaround/Solution

NA

Steps to Reproduce

  1. Open this page https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/Yashaswi-1998/OpenApi/main/Imagekit.yaml#/operations/upload-file
  2. Fill the try it section(attached screenshot) with below details
Screenshot 2024-07-30 at 12 56 47 PM

Authorization => Basic cHJpdmF0ZV9VUXZwU2tRVGRheGlYcXNaZStOaGd0by9iZ3c9Og==
file* =>https://media.istockphoto.com/id/1127245421/photo/woman-hands-praying-for-blessing-from-god-on-sunset-background.webp?b=1&s=170667a&w=0&k=20&c=bPoh4FbWez1Za2_DfgYY2VlZ3F6RKtx9_OF8I5ZSpXU=
fileName* => demoFileName

Now after this if we will click on Send API Request it will throw below error

{
    "message": "Your request is missing fileName parameter.",
    "help": "For support kindly contact us at [email protected] ."
}

This error is occurring because when we check payload under network tab in inspect panel, it is empty
Screenshot 2024-07-30 at 1 02 46 PM

Environment

Prod

@mnaumanali94 mnaumanali94 added t/bug Something isn't working p/medium triaged labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/medium t/bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants