-
Notifications
You must be signed in to change notification settings - Fork 418
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
Implement multipart body support in sttp stub #3902
Comments
/bounty $500 |
💎 $500 bounty • SoftwareMillSteps to solve:
Thank you for contributing to softwaremill/tapir! Add a bounty • Share on socials
|
Hey @adamw! I’d love to take a crack at adding multipart body support to the sttp stub. Here’s what I am thinking for the approach: Right now, the code throws an exception for MultipartBody. My idea is to properly parse multipart bodies instead of the exception. I will iterate over the parts, handling text and files and convert them into something Tapir can understand like I will also create some test cases that include multipart bodies with both text and file parts. Does this sound good? I will get started and push a PR soon if all looks good to you! With this,
|
@asr2003 Hey, great to see your interest in the issue! :) I'm not sure doing full multipart serialisation & parsing will be necessary (unless I'm missing something), but maybe it will be enough to remain on a higher level. I think a great start would be to create (failing) tests which would demonstrate how people might use the feature: either directly via sttp-client, or by interpreting the endpoint as a client. This should probably be an extension to the existing testsuite. Then we might work out what exactly is missing to make this work. |
/attempt #3902 Options |
As we are getting first PRs for the bounties, I've published our "How to prepare a good PR" guide. I should have probably done this right away, sorry! :) |
/attempt #3902 Options |
💡 @abdelfetah18 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
@abdelfetah18: You've been awarded a $500 bounty by softwaremill! 👉 Complete your Algora onboarding to collect the bounty. |
Multipart support was never added to the stub:
tapir/server/sttp-stub-server/src/main/scala/sttp/tapir/server/stub/SttpRequestBody.scala
Line 49 in abeb5d7
This makes it impossible to test endpoints with multipart bodies.
Originally posted by @adamw in #3895 (comment)
The text was updated successfully, but these errors were encountered: