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

Remove requirement to specify path with per-HTTP-method methods. #64

Open
garretwilson opened this issue Sep 27, 2017 · 2 comments
Open

Comments

@garretwilson
Copy link

I see that Condition has convenience methods for specific HTTP methods, such as Condition.get(String uri). That's fine if I want to specify an exact path. But what if I want to use that in conjunction with Condition.matchesUri(Pattern p)? Why isn't there a Condition.get() method I can use like this?

whenHttp(server).matches(get(), matchesUri(Pattern.compile("a?b+c*")))…

Why can't I just use get() by itself, to combine it with any matcher I want?

You might say I could just use Condition.method(Method m), but as explained in #22 that forces me to use the Glassfish API --- and there's no need for that. If there is a Condition.get() method at all, why is it tied to a URI, when I could simply say matches(get(), uri("foo")) to do the same thing as matches(get("foo"))?

Yes, I understand that get(String uri) is a convenience method, but convenience methods should allow the long, more flexible form as well. Put another way, it is more flexible to allow matches(get(), uri("foo")), and provide matches(get("foo")) as an additional convenience. Only providing the latter without the former makes the API less flexible.

@mkotsur
Copy link
Owner

mkotsur commented Sep 28, 2017

Good point. Same thing - I'd happily accept a PR for that and quickly make a new release. Or I can pick it up based on time availability.

@garretwilson
Copy link
Author

It's possible that I could have a developer available to address some of these issues (e.g. #65 and the others we've been discussing) in about a month or two; if so, I would be happy to contribute!

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