Skip to content
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

Feature request : registering response interceptors #126

Closed
laurentperez opened this issue Sep 15, 2014 · 3 comments
Closed

Feature request : registering response interceptors #126

laurentperez opened this issue Sep 15, 2014 · 3 comments
Milestone

Comments

@laurentperez
Copy link

Hi
I'd like to feature request the ability to register a response interceptor, much like you can register request "interceptors" by populating window.authorizations with custom parameters.
I know this can somehow break the stateless nature of a call, given that I could reuse parts of the response to alter future requests. But it'd be the sole caller responsibility.
My use case is : I call a login service, it gives me a security token, and I have to use the token for other api requests.
I hacked swagger.js to retain the response object in localStorage, but it's ugly.
Objections ?

@fehguy fehguy added this to the v2.0.48 milestone Dec 24, 2014
@fehguy
Copy link
Contributor

fehguy commented Jan 6, 2015

hi, i think this is a good feature but we need to be careful about both the signature and nature of the calls. For instance, it's fine if it's a synchronous interceptor but doing something that chains the response in a callback will certainly break the clients.

I'd like to push this into a future release but keep the feature request open so we can work through first the ideal behavior, and next the signature for the interceptor.

@fehguy fehguy removed this from the v2.0.48 milestone Jan 6, 2015
@fehguy fehguy added this to the v2.1-M2 milestone Feb 1, 2015
@whitlockjc
Copy link
Contributor

I think we should work on this when we make SwaggerHttp pluggable.

@fehguy
Copy link
Contributor

fehguy commented May 14, 2015

now that SwaggerHttp is pluggable, this poses another challenge. Should the interceptor be handled in the pluggable client? Looking into this more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants