-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Query param route predicate - extension of QueryRoutePredicateFactory #3472
base: main
Are you sure you want to change the base?
Conversation
A predicate that checks if a query parameter value matches criteria of a given predicate.
# Conflicts: # spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/route/builder/PredicateSpec.java
I'd prefer this in one class as having multiple query predicates is confusing. |
@spencergibb you are suggesting to merge the two classes into one single predicate factory, that can manage both cases, right? I can do it, paying attention not to introduce regressions on the QueryRoutePredicateFactory. |
@polifr yes, since this will only be available thru the java dsl, it should be ok. the regex can be retrofit to a Predicate. |
@spencergibb I modified the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can now remove QueryParamRoutePredicateFactory
...ain/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactory.java
Show resolved
Hide resolved
...ain/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactory.java
Show resolved
Hide resolved
|
Ok, I removed the |
I tried to generalize the QueryRoutePredicateFactory so that it could use a bean of type Predicate instead of being limited to a regexp. Test classes are also implemented.