Add support for requestInterceptor / responseInterceptor.

- Display mutated requests from request interceptor in curl output in UI.
  Put this behind showMutatedRequest flag so that the mutation can be
  silent.
- Document requestInterceptor, responseInterceptor and showMutatedRequest
  in README.md
- Add tests
This commit is contained in:
Mike Gilbode
2017-08-13 01:11:04 -04:00
parent c88c8c32f3
commit 087ed20384
10 changed files with 189 additions and 7 deletions

View File

@@ -42,6 +42,9 @@ module.exports = function SwaggerUI(opts) {
displayOperationId: false,
displayRequestDuration: false,
deepLinking: false,
requestInterceptor: (a => a),
responseInterceptor: (a => a),
showMutatedRequest: true,
// Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance.
// Instead, we can compile the first plugin ( it can be a collection of plugins ), then batch the rest.