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 for URL parameters #89

Closed
tonyarnold opened this issue Jun 5, 2024 · 3 comments
Closed

Support for URL parameters #89

tonyarnold opened this issue Jun 5, 2024 · 3 comments

Comments

@tonyarnold
Copy link
Contributor

Vapor and Hummingbird both have a great feature where you can specify post parameters as part of the URL/Route using the form:

/ax/objects/:id

Where :id is accessible as a parameter that is replaced by the passed value.

It would be great to have this same support in FlyingFox at some point!

@swhitty
Copy link
Owner

swhitty commented Jun 6, 2024

Ah nice, the preview/macro branch provides a glimpse of what I want it to eventually achieve when macros become feasible to use in lightweight packages.

My plan is to eventually match some elements within the route to the handler as named parameters removing the need to force unwrap:

@HTTPRoute("/ax/objects/:id")
func getObject(id: Int) -> HTTPResponse

My imagination had struggled to think up what this future syntax would be maybe {id} but I'm happy to follow prior art here.

@tonyarnold
Copy link
Contributor Author

I've started an implementation of this that builds on the changes in #91 at: tonyarnold#1

@swhitty
Copy link
Owner

swhitty commented Jul 15, 2024

Released in 0.15.0

@swhitty swhitty closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants