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

please add more specific naming #1

Open
benspratling4 opened this issue Nov 3, 2022 · 1 comment
Open

please add more specific naming #1

benspratling4 opened this issue Nov 3, 2022 · 1 comment

Comments

@benspratling4
Copy link

I like where you're going with this, but I'd love to see some more specific names. Sort of how in UIKit UIStackView could do both .horizontal and .vertical axes, so Route can do .POST and .GET. But in SwiftUI, we have separate HStack and VStack. I'd love to see all the Routes become

GET("todos") {
....
}

Or

POST("todos" ...)

And Route is a final class, so declare them as static functions which return Routes for all I care!
func GET(_ path:String, ...)->Route
Will get you 90% of the way there.

And please please please make "Group" more understandable, maybe

SubPath("api") {
....
}

@danny1113
Copy link
Owner

Making API more clear is a good direction.

GET and POST just a wrapper on Route, so it is easy to add, but change Group to SubPath could be a source breaking change, so the version needs to be bump up to 2.0.0.

So I'll add GET, POST, PUT, DELETE, PATCH in version 1.1.0,
and I think maybe there is another name that could be more suitable for this than SubPath?
I'll take into consideration.

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