File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
packages/react-openapi/src Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @gitbook/react-openapi ' : patch
3+ ---
4+
5+ Fixed scalar api client routing
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export function OpenAPICodeSample(props: {
119119 tabs = { samples }
120120 overlay = {
121121 data [ 'x-hideTryItPanel' ] || data . operation [ 'x-hideTryItPanel' ] ? null : (
122- < ScalarApiButton />
122+ < ScalarApiButton method = { data . method } path = { data . path } />
123123 )
124124 }
125125 />
Original file line number Diff line number Diff line change @@ -6,12 +6,15 @@ import React from 'react';
66/**
77 * Button which launches the Scalar API Client
88 */
9- export function ScalarApiButton ( ) {
9+ export function ScalarApiButton ( { method , path } : { method : string ; path : string } ) {
1010 const client = useApiClientModal ( ) ;
1111
1212 return (
1313 < div className = "scalar scalar-activate" >
14- < button className = "scalar-activate-button" onClick = { ( ) => client ?. open ( ) } >
14+ < button
15+ className = "scalar-activate-button"
16+ onClick = { ( ) => client ?. open ( { method, path } ) }
17+ >
1518 < svg xmlns = "http://www.w3.org/2000/svg" width = "10" height = "12" fill = "none" >
1619 < path
1720 stroke = "currentColor"
You can’t perform that action at this time.
0 commit comments