You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No change in the default configuration except for including my custom plugin
Screenshots
How can we help?
I was trying to understand the plugin system to configure Swagger for my use case. As an experiment, I wanted to try and disable the collapse feature. I created a custom plugin with the following code.
This results in swagger showing errors which include
Warning: Failed prop type: The prop `jumpToKey` is marked as required in `OperationContainer`, but its value is `undefined`.
Warning: Failed prop type: The prop `isDeepLinkingEnabled` is marked as required in `OperationContainer`, but its value is `undefined`.
I'm guessing this is because container components need to be obtained with getComponent(<name>, true). Is it possible to override container components' behavior?
You can't wrap the container component because it maps the Redux state to props that it gives itself. The exact mechanism of failure isn't clear, but when you wrap the component, it breaks 😄
Fortunately, you can get at the toggleShown prop from OperationWrapper:
()=>{{return{wrapComponents: {operation: (OriginalComponent,system)=>(props)=>{constfn=()=>{props.toggleShown&&props.toggleShown()// call original if it existsconsole.log("Success")}return<OriginalComponent{...props}toggleShown={fn}/>}}}}}
This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.
Locking due to inactivity.
This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.
If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.
Thanks!
Q&A (please complete the following information)
Content & configuration
No change in the default configuration except for including my custom plugin
Screenshots
How can we help?
I was trying to understand the plugin system to configure Swagger for my use case. As an experiment, I wanted to try and disable the collapse feature. I created a custom plugin with the following code.
This results in swagger showing errors which include
I'm guessing this is because container components need to be obtained with
getComponent(<name>, true)
. Is it possible to override container components' behavior?Thanks!
P.S. @ponelat Your blog post helped a lot!
The text was updated successfully, but these errors were encountered: