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

Support query parameters with multiple values in Endpoint API #2321

Closed
jdegoes opened this issue Jul 27, 2023 · 18 comments
Closed

Support query parameters with multiple values in Endpoint API #2321

jdegoes opened this issue Jul 27, 2023 · 18 comments
Labels

Comments

@jdegoes
Copy link
Member

jdegoes commented Jul 27, 2023

Currently every query parameter is supposed to yield an A, but this should probably be changed to yield a NonEmptyChunk[A].

The main work is modifying Query which extends HttpCodec (inside the companion object of HttpCodec, located in file HttpCodec.scala) from extends HttpCodec[A] to extends HttpCodec[NonEmptyChunk[A]]. The secondary task is to modify the EncoderDecoder.scala so that it properly encodes and decodes non-empty chunks for query parameters.

@jdegoes jdegoes added the enhancement New feature or request label Jul 27, 2023
@NavidJalali
Copy link
Contributor

I can give this a go

@jdegoes
Copy link
Member Author

jdegoes commented Jul 27, 2023

/bounty $125

@algora-pbc
Copy link

algora-pbc bot commented Jul 27, 2023

💎 $125 bounty created by ZIO
🙋 If you start working on this, comment /attempt #2321 to notify everyone
👉 To claim this bounty, submit a pull request that includes the text /claim #2321 somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to zio/zio-http!

👉 Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @mpanigrahi Aug 9, 2023, 4:29:43 AM WIP
🟢 @eshu Oct 7, 2023, 7:49:14 AM WIP
🟢 @ekhov Jan 15, 2024, 7:49:20 PM #2631

@mpanigrahi
Copy link

mpanigrahi commented Aug 9, 2023

/attempt #2321

Options

@mpanigrahi
Copy link

mpanigrahi commented Aug 9, 2023

/attempt #2321

Options

@algora-pbc
Copy link

algora-pbc bot commented Aug 16, 2023

@mpanigrahi: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

@algora-pbc
Copy link

algora-pbc bot commented Aug 23, 2023

The bounty is up for grabs! Everyone is welcome to /attempt #2321 🙌

@eshu
Copy link

eshu commented Oct 5, 2023

Currently every query parameter is supposed to yield an A, but this should probably be changed to yield a NonEmptyChunk[A].

The main work is modifying Query which extends HttpCodec (inside the companion object of HttpCodec, located in file HttpCodec.scala) from extends HttpCodec[A] to extends HttpCodec[NonEmptyChunk[A]]. The secondary task is to modify the EncoderDecoder.scala so that it properly encodes and decodes non-empty chunks for query parameters.

@jdegoes

It does not look so simple. It does not look possible to make Query[A] just extends HttpCodec[NonEmptyChunk[A]], it breaks a lot of things inside, such as operator ++, Query.optional, I think there are many other things. So Query should stay as HttpCodec[A].

In other hand when I try to change just EncoderDecoder, it breaks Mechanic object in makeConstructorLoop method (coerce function).

Maybe there should be a special case Query or TextCodec.

Sorry, I saw this code just yesterday and I do not have a good understanding what is going on under the hood, most probably my thoughts are amateurish.

Update: I can't push the branch with changes, contributer's guide in README.md leads to 404 page (as well as Code of Conduct).

@eshu
Copy link

eshu commented Oct 7, 2023

/attempt #2321

Options

@eshu
Copy link

eshu commented Oct 7, 2023

@jdegoes
I have two solutions:
#2472 - I prefer this one
#2473 - I think ity could be acceptable, but I do not like it because of SeqCodec.encode.
Before I'll continue with tests I would like to know the opinion of maintainers which one is good.

eshu added a commit to eshu/zio-http that referenced this issue Oct 7, 2023
eshu added a commit to eshu/zio-http that referenced this issue Oct 7, 2023
eshu added a commit to eshu/zio-http that referenced this issue Oct 7, 2023
eshu added a commit to eshu/zio-http that referenced this issue Oct 7, 2023
eshu added a commit to eshu/zio-http that referenced this issue Oct 9, 2023
@eshu
Copy link

eshu commented Oct 12, 2023

@jdegoes Check the PR please :)
#2472

@eshu
Copy link

eshu commented Oct 21, 2023

No need anymore?

@elisee-assinou
Copy link

i can work on this

@eshu
Copy link

eshu commented Dec 8, 2023

@jdegoes This is not a question of money. I did not try to solve this issue for money.I do not think I can receive them because of the local specifics. I was inspired by your inspiring videos on youtube, read your messages in SN and thought that it is possible to do something for this project. But it looks like this project is in the stage "nobody cares". :(

@ekhov
Copy link
Contributor

ekhov commented Jan 15, 2024

/attempt #2321

Copy link

algora-pbc bot commented Jan 15, 2024

Note

The user @eshu is already attempting to complete issue #2321 and claim the bounty. We recommend checking in on @eshu's progress, and potentially collaborating, before starting a new solution.

Copy link

algora-pbc bot commented Jan 18, 2024

💡 @ekhov submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Copy link

algora-pbc bot commented Jan 24, 2024

🎉🎈 @ekhov has been awarded $125! 🎈🎊

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

8 participants