Add a custom header to swagger2

ui.getConfigs().requestInterceptor = (req) => { req.headers.haley_test = "1"; return req;}

Add a custom header to swagger1

swaggerUi.api.clientAuthorizations.add("haley_test", new SwaggerClient.ApiKeyAuthorization("haley_test", "1", "header"));