-
Notifications
You must be signed in to change notification settings - Fork 371
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
Friendlier Forms in ZIO HTTP #1953
Conversation
Codecov ReportBase: 62.16% // Head: 62.49% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #1953 +/- ##
==========================================
+ Coverage 62.16% 62.49% +0.33%
==========================================
Files 196 204 +8
Lines 5849 6045 +196
Branches 208 220 +12
==========================================
+ Hits 3636 3778 +142
- Misses 2213 2267 +54
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
/** | ||
* Represents a form that can be either multipart or url encoded. | ||
*/ | ||
sealed trait Form { self => |
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.
Perhaps FormData
instead of Form
?
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.
That was my first preference, but there is already a FormData
elsewhere in the codebase :(
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.
Maybe we can consolidate?
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.
I am using now using FormData
. However, I don't see a reasonable way to combine it as the other variant is only related to ContentDisposition
.
While this initial implementation conveys what I feel the form API should look like from a usability perspective it ends up being too naive to support the more complex cases one might encounter when dealing I will continue experimenting to come up with an implementation powerful enough for the multipart case yet remains simple and performant in the urlencoded case. |
@scottweaver Please re-open when you're ready for another look! |
Pretty much a rewrite from the ground up that supports both The only functionality remaining is support of 'multipart/mixed' for multipart forms. |
7f3aa6e
to
6610d92
Compare
This is pretty much complete rewrite of the previous Friendly Forms API that only initially supported 'application/x-www-form-urlencoded'. User API: Form ============== 'zio.http.forms.Form' provides the user the tools they need to: - Encode 'application/x-www-form-urlencoded' to a 'zio.http.Body'. - Decode a 'zio.http.Body' that is encoded as 'application/x-www-form-urlencoded' to a 'zio.http.forms.Form'. - Encode 'multipart/form-data ' to a 'zio.http.Body'. - Decode a 'zio.http.Body' that is encoded as 'multipart/form-data' to a 'zio.http.forms.Form'.
47529a3
to
6e6146b
Compare
Friendly Forms MK II
This is pretty much complete rewrite of the previous Friendly Forms API that only initially supported 'application/x-www-form-urlencoded'.
User API: Form
'zio.http.forms.Form' provides the user the tools they need to: