-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(apidocs): add resolvers prop to AsyncApiDefinitionWidget #25325
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Simon Stamm <simon.stamm@tui.com>
Changed Packages
|
@vinzscam Sorry for the ping, any chance you could take a quick look at this? It's just an additional feature, nothing will change. Thank you very much! |
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.
Hi! It looks good, just a couple of small suggestions
plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinition.tsx
Outdated
Show resolved
Hide resolved
plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinition.tsx
Show resolved
Hide resolved
const classes = useStyles(); | ||
const theme = useTheme(); | ||
const classNames = `${classes.root} ${ | ||
theme.palette.type === 'dark' ? classes.dark : '' | ||
}`; | ||
|
||
// Overwrite default resolvers if custom ones are set | ||
if (resolvers) { | ||
config.parserOptions.__unstable.resolver.resolvers = resolvers; |
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.
does it make sense to cover the case where someone wants to add an extra resolver to the default ones?
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 have also thought about this case, but which should be additional protocols to http and https. So I made it easier by overriding it.
…tion component Signed-off-by: Simon Stamm <simon.stamm@tui.com>
Hey, I just made a Pull Request!
This adds
resolvers
prop toAsyncApiDefinitionWidget
which allows to override the default http/https resolvers, for example to add authentication to requests to internal schema registries.✔️ Checklist
Signed-off-by
line in the message. (more info)