zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
751 stars 382 forks source link

Improve Routes DSL to support complex URI template patterns #2679

Closed limpid-kzonix closed 6 days ago

limpid-kzonix commented 5 months ago

Is your feature request related to a problem? Please describe. Extend capabilities of ZIO HTTP routes to cover use cases described in RFC 6570 - URI Template The issue that I came across is that the current ZIO Route DSL does not support defining complex use cases such as the following:

Just for reference: https://docs.micronaut.io/latest/guide/#routing, Many other frameworks, including Spring, Quarkus, dotnet, actix-web, implement the URI template specification. But no single scala HTTP library is capable of that.

It would be nice to have the flexibility to define complex routes via Route DSL and Endpoint DSL to have a well-designed and documented API.

image

It seems that it is not possible right now to define a route that will follow Resource Oriented API with custom methods (more details here)

I remember that something similar was discussed in the zio-http discord channel - https://discord.com/channels/629491597070827530/819703129267372113/1162396036237623326 but without proper resolution.

Describe the solution you'd like I want to have DLS that provide an ability to define

Describe alternatives you've considered

@erikvanoosten, probably you have some ideas, coz I remember discussion in discord about problem related to this issue.

Additional context https://softwaremill.community/t/paths-components-without-separator/317

jdegoes commented 1 month ago

/bounty $750 for solution that does not impact performance and remains "zero allocation" and efficient, as well as backward compatible.

algora-pbc[bot] commented 1 month ago

πŸ’Ž $750 bounty β€’ ZIO

Steps to solve:

  1. Start working: Comment /attempt #2679 with your implementation plan
  2. Submit work: Create a pull request including /claim #2679 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bounty β€’ Share on socials

Attempt Started (GMT+0) Solution
πŸ”΄ @bradovitt Jun 23, 2024, 2:25:03 AM WIP
🟑 @kyri-petrou Jun 30, 2024, 2:56:28 AM #2959
🟒 @987Nabil #2959
bradovitt commented 4 weeks ago

/attempt #2679

algora-pbc[bot] commented 3 weeks ago

@bradovitt: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then πŸ™

kyri-petrou commented 3 weeks ago

/attempt #2679

Algora profile Completed bounties Tech Active attempts Options
@kyri-petrou 18 ZIO bounties
Scala, Python,
Shell & more
Cancel attempt
algora-pbc[bot] commented 3 weeks ago

[!NOTE] The user @bradovitt is already attempting to complete issue #2679 and claim the bounty. We recommend checking in on @bradovitt's progress, and potentially collaborating, before starting a new solution.

algora-pbc[bot] commented 2 weeks ago

@kyri-petrou: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then πŸ™

algora-pbc[bot] commented 1 week ago

πŸ’‘ @987Nabil and @kyri-petrou submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 6 days ago

πŸŽ‰πŸŽˆ @987Nabil has been awarded $375! 🎈🎊

algora-pbc[bot] commented 6 days ago

πŸŽ‰πŸŽˆ @kyri-petrou has been awarded $375! 🎈🎊