-
Notifications
You must be signed in to change notification settings - Fork 359
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
Support for multipart/form-data in the request body #2321
Merged
chohmann
merged 24 commits into
stoplightio:master
from
ilanashapiro:feature/multipart-form-data-validation
Jul 28, 2023
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f0f4fc0
add test for (currently failing) multipart form data POST requests --…
ilanashapiro a541db8
implement support for multipart/form-data requests with working test
ilanashapiro cbf87de
added tests to the test harness for multipart/form-data
ilanashapiro 9baa519
delete commented out code
ilanashapiro 84a6490
Parse multiform data passed with -F flag rather than --data flag
ilanashapiro 55364bd
Parse multiform data passed with -F flag rather than --data flag
ilanashapiro 51f6722
Merge branch 'stoplightio:master' into feature/multipart-form-data-va…
ilanashapiro c0410d0
resolve merge
ilanashapiro b954b44
add test files and cleanup whitespace
ilanashapiro 57b53d9
delete tests not relevant to multipart form data
ilanashapiro fffddeb
resolve conflict in yarn.lock file
ilanashapiro b568f73
use npm package to parse boundary string and form data from multipart
ilanashapiro 4a0a530
resolve yarn.lock conflict
ilanashapiro 2c9f3a3
improve error message for missing boundary
ilanashapiro 2466aff
add null checks for parsing boundary from content-type hea
ilanashapiro c81993f
handle whitespace in the other location media type and boundary strin…
ilanashapiro 79dedc5
resolve merge conflict in yarn.lock
ilanashapiro 53bfedd
parse MIME header with library, improve error handling/add tests for …
ilanashapiro e209c1b
attempt to resolve node install error on server by committing generat…
ilanashapiro fb50bc7
fix formatting
ilanashapiro 8a6a229
condense verbose code block
ilanashapiro 9818ba0
condense verbose code block
ilanashapiro 362a79d
Merge branch 'feature/multipart-form-data-validation' of https://gith…
ilanashapiro b2df062
Merge branch 'master' into feature/multipart-form-data-validation
chohmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"surname" : "Doe", | ||
"name" : "John", | ||
"city" : "Manchester", | ||
"address" : "5 Main Street", | ||
"hobbies" : ["painting","lawnbowls"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseMultipartFormDataParams returns an error wrapped in E.Left if the boundary sting is empty. Here I convert that to a default value (i.e. empty dictionary) if that occurs. I'm not sure if I'm supposed to be doing anything else here -- this same behavior (unwrapping the monad using defaults) is implemented for findContentByMediaTypeOrFirst just below on line 169, so I attempted to emulate that.