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: {
119
119
tabs = { samples }
120
120
overlay = {
121
121
data [ 'x-hideTryItPanel' ] || data . operation [ 'x-hideTryItPanel' ] ? null : (
122
- < ScalarApiButton />
122
+ < ScalarApiButton method = { data . method } path = { data . path } />
123
123
)
124
124
}
125
125
/>
Original file line number Diff line number Diff line change @@ -6,12 +6,15 @@ import React from 'react';
6
6
/**
7
7
* Button which launches the Scalar API Client
8
8
*/
9
- export function ScalarApiButton ( ) {
9
+ export function ScalarApiButton ( { method , path } : { method : string ; path : string } ) {
10
10
const client = useApiClientModal ( ) ;
11
11
12
12
return (
13
13
< 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
+ >
15
18
< svg xmlns = "http://www.w3.org/2000/svg" width = "10" height = "12" fill = "none" >
16
19
< path
17
20
stroke = "currentColor"
You can’t perform that action at this time.
0 commit comments