-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
SwaggerEditor@next: passing the configuration to AsyncAPI plugin #5006
Comments
This PR (#5007) opened possibility to pass additional configuration to AsyncAPI React Component. To actually pass a configuration to AsyncAPI React Component, const AsyncAPICustomConfigPlugin = () => ({
wrapComponents: {
EditorPreviewAsyncAPIReactComponent: (Original) => ({ schema, config: defaultConfig }) => {
// defaultConfig = { show: { errors: true } }
const customConfig = { ...defaultConfig, sidebar: true };
return <Original schema={schema} config={customConfig} />;
}
}
})
const root = createRoot(document.getElementById('swagger-editor'));
root.render(
<SwaggerEditor
url="https://raw.githubusercontent.com/asyncapi/spec/v2.6.0/examples/streetlights-kafka.yml"
plugins=[AsyncAPICustomConfigPlugin]
/>
); |
char0n
added a commit
that referenced
this issue
May 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refs #4493
The text was updated successfully, but these errors were encountered: