-
-
Couldn't load subscription status.
- Fork 1.3k
Fix interceptor JSON casing #2907
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
Conversation
Fix property casing of Swagger UI interceptor function properties. Resolves domaindrivendev#2906.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2907 +/- ##
=======================================
Coverage 89.89% 89.89%
=======================================
Files 72 72
Lines 2711 2711
Branches 429 429
=======================================
Hits 2437 2437
Misses 274 274
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// Accepts one argument requestInterceptor(request) and must return the modified request, or a Promise that resolves to the modified request. | ||
| /// Ex: "function (req) { req.headers['MyCustomHeader'] = 'CustomValue'; return req; }" | ||
| /// </summary> | ||
| [JsonPropertyName("RequestInterceptorFunction")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the rest of the config properties are serialized to camel case, I wonder would it be better to maintain that consistency and just update the assignment in index.html?
Swashbuckle.AspNetCore/src/Swashbuckle.AspNetCore.SwaggerUI/index.html
Lines 99 to 103 in 432c417
| var interceptors = JSON.parse('%(Interceptors)'); | |
| if (interceptors.RequestInterceptorFunction) | |
| configObject.requestInterceptor = parseFunction(interceptors.RequestInterceptorFunction); | |
| if (interceptors.ResponseInterceptorFunction) | |
| configObject.responseInterceptor = parseFunction(interceptors.ResponseInterceptorFunction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought but not a showstopper for me other than that looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh didn't realize we had auto-merge - oh well I guess we leave it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did consider renaming it, but this persuaded me to leave it alone: #2906 (comment)
Fix property casing of Swagger UI interceptor function properties.
Resolves #2906.