This PR isn't anywhere near ready to go, but since things are a little complex I thought it might make sense to do a quick validation check before polishing all the rough edges.
With that in mind, this PR adds a prototype for request Interceptors, which are intended to allow users to modify Netable Requests at runtime and do things like add headers, mock out endpoints, or whatever else they'd like.
A couple goals/intended patterns:
Interceptors should be chainable, so that you can apply multiple interceptors to the same request
Request specific interceptors should take priority over global interceptors
A request level mock json should take precedence over a global one, but otherwise use the first mock JSON returned by an interceptor
While I think there's an argument to be made for simplifying things and not allowing chainable interceptors, I think it's a little more awkward to change our minds later and add in that functionality after the fact, so if it's not too much more work to make interceptors able to chain now that feels like it's worth doing to me.
For #118
This PR isn't anywhere near ready to go, but since things are a little complex I thought it might make sense to do a quick validation check before polishing all the rough edges.
With that in mind, this PR adds a prototype for request Interceptors, which are intended to allow users to modify Netable Requests at runtime and do things like add headers, mock out endpoints, or whatever else they'd like.
A couple goals/intended patterns:
While I think there's an argument to be made for simplifying things and not allowing chainable interceptors, I think it's a little more awkward to change our minds later and add in that functionality after the fact, so if it's not too much more work to make interceptors able to chain now that feels like it's worth doing to me.