cognitect-labs / vase

Data driven microservices
Eclipse Public License 1.0
374 stars 40 forks source link

Name the api description interceptor. #14

Closed ddeaguiar closed 8 years ago

ddeaguiar commented 8 years ago

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.

ohpauleez commented 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.

ddeaguiar commented 8 years ago

@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.

ohpauleez commented 8 years ago

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.

ddeaguiar commented 8 years ago

Ok.

ddeaguiar commented 8 years ago

@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?