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
I saw this which seems to indicate I can't wrap OperationContainer, so now I'm at a loss. I also cannot find any examples of anyone trying to modify the description of an endpoint in a plugin.
I have tried looking through operation props and I can't seem to find any way to access description.
The text was updated successfully, but these errors were encountered:
This is possible, but the operation component interface just happens to be the most convoluted interface in the entire app (😓) so it's not immediately obvious how to do it.
Here's my implementation:
constModifyDescriptionPlugin=function(){return{wrapComponents: {operation: (Original,{ React })=>props=>{const{ operation }=propsif(operation.get("path")==="/pet/findByStatus"&&operation.get("method")==="get"&&operation.get("op").size// i.e., resolved Operation has been provided){constoriginalDescription=operation.getIn(["op","description"])returnReact.createElement(Original,{
...props,operation: operation.setIn(["op","description"],originalDescription+"\n\n*Hello world!*")})}returnReact.createElement(Original,props)}}}}
Q&A
Content & configuration
I'm trying to write a custom plugin that will append to the description for a particular endpoint, using wrapComponents.
I saw this which seems to indicate I can't wrap OperationContainer, so now I'm at a loss. I also cannot find any examples of anyone trying to modify the description of an endpoint in a plugin.
I have tried looking through operation props and I can't seem to find any way to access description.
The text was updated successfully, but these errors were encountered: