Filters in the route Spec are easy to confuse
See original GitHub issueIs your feature request related to a problem? Please describe. As a beginner user, I confused pre- and post- filters. The Spec builder API feels like it is a builder, but, in fact, it depends on the order.
From looking at the following, it is hard to answer “does it work the same?”:
r
.method(HttpMethod.PUT)
.filters(f -> f.filter(myFilter))
.uri("http://mytarget/");
vs:
r
.method(HttpMethod.PUT)
.uri("http://mytarget/")
.filter(myFilter);
Describe the solution you’d like I suggest renaming the methods, so that it becomes:
r
.method(HttpMethod.PUT)
.preFilters(f -> f.filter(requireAccessTokenFilter))
.uri("http://mytarget/")
.postFilter(removeOriginHeadersFiltler);
Describe alternatives you’ve considered None at the moment.
Additional context This is a follow of #1645.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Understanding Route Filters for Use in Routing Policy Match ...
A route filter is a collection of match prefixes. When specifying a match prefix, you can specify an exact match with a particular...
Read more >svenfuchs/routing-filter - GitHub
Routing filters wrap around the complex beast that the Rails routing system is to allow for unseen flexibility and power in Rails URL...
Read more >Filtering BGP advertisements, routes, etc. - Cisco Community
Solved: What would be the best way to filter route advertisements from and to a BGP ... It is easy to add a...
Read more >9. Routing Policy and Firewall Filters - JUNOS Cookbook [Book]
However, because they are so similar, it's sometimes easy to confuse the two. The most important point to remember is that routing policy...
Read more >Routing & Input - R Plumber
Plumber has two distinct families of functions that it handles: endpoints and filters. Typically, when a request arrives to a Plumber router, Plumber...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a fix, but it is a breaking change since the javadsl is leaky and returns a builder from outside the dsl.
never mind, the fact that there is a
.filter()
method after.uri()
is the oddity, it should be a terminal builder method (maybe?). You should use.filters(f -> {})
after the predicate.