Closed ddeaguiar closed 8 years ago
We should revert this change or make another PR on top of it.
While not enforced, interceptor names should be namespaced, unique keys -- OR-- anonymous and nameless. I could see extracting a name from the routes, passing in another (optional) arg for the name, gen-sym with some base string, or some combination of those options.
@ohpauleez, how about ::describe-api
then? I can create a PR that implements that change and addresses the interceptors named in interceptor.clj as well.
The problem with ::describe-api
is that it's not unique if the function is called multiple times (for example, with creating and merging lots of APIs together). I think one of the three options (or some combo of them) would suffice for an adequate patch. I'm also open to other ideas.
Ok.
@ohpauleez, thinking about this further, I think what may be more useful is keeping the interceptor anonymous and adding meta data which captures the interceptor type. Thoughts on that?
In general, I think it's useful to name all interceptors. In this case, naming this interceptor allows the
make-interceptors-fn
to easily check if it's present in the interceptor chain.