Skip to content

how to use swagger statePlugins in react app #6132

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

Open
sanjaychakravorty opened this issue Jun 12, 2020 · 3 comments
Open

how to use swagger statePlugins in react app #6132

sanjaychakravorty opened this issue Jun 12, 2020 · 3 comments

Comments

@sanjaychakravorty
Copy link

sanjaychakravorty commented Jun 12, 2020

i have gone through with below url to implement statePlugins in existing any app.
but i could not understand how to inject those in our react app.
please any running sample project is available for this. please let me guid how to invoke/use in our react app.
https://github.com/swagger-api/swagger-ui/blob/master/docs/customization/plugin-api.md

{
statePlugins: {
[stateKey]: {
actions,
reducers,
selectors,
wrapActions,
wrapSelectors
}
},
components: {},
wrapComponents: {},
rootInjects: {},
afterLoad: (system) => {},
fn: {},
}

@suvirbhargav
Copy link

There is a catalog here to get you started, #5027

@sanjaychakravorty
Copy link
Author

sanjaychakravorty commented Jun 14, 2020

Thanks suvirbhargav, thanks for reply. actually i am trying to implement swagger ui as a widget.that means i have multiple components in my index react app and based on condition only one operation part of swagger ui should be rendered in one component is called here widget.please suggest me how can i perform this approach.

@suvirbhargav
Copy link

Look at the code in this thread, here you see how to hide try it out button, #6124
Similarly, you can do other things using swagger ui plugin approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants