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

feat(apidocs): add resolvers prop to AsyncApiDefinitionWidget #25325

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

simonstamm
Copy link
Contributor

Hey, I just made a Pull Request!

This adds resolvers prop to AsyncApiDefinitionWidget which allows to override the default http/https resolvers, for example to add authentication to requests to internal schema registries.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Simon Stamm <simon.stamm@tui.com>
@simonstamm simonstamm requested review from a team as code owners June 19, 2024 15:59
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Jun 19, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-api-docs plugins/api-docs patch v0.11.7-next.0

@simonstamm
Copy link
Contributor Author

@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!

Copy link
Member

@vinzscam vinzscam left a 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

.changeset/plenty-mails-do.md 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;
Copy link
Member

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?

Copy link
Contributor Author

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants