File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed
packages/react-openapi/src Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @gitbook/react-openapi ' : patch
3
+ ---
4
+
5
+ Indent JSON python code sample
Original file line number Diff line number Diff line change @@ -356,18 +356,22 @@ const BodyGenerators = {
356
356
// Convert JSON to XML if needed
357
357
body = JSON . stringify ( convertBodyToXML ( body ) ) ;
358
358
} else {
359
- body = stringifyOpenAPI ( body , ( _key , value ) => {
360
- switch ( value ) {
361
- case true :
362
- return '$$__TRUE__$$' ;
363
- case false :
364
- return '$$__FALSE__$$' ;
365
- case null :
366
- return '$$__NULL__$$' ;
367
- default :
368
- return value ;
369
- }
370
- } )
359
+ body = stringifyOpenAPI (
360
+ body ,
361
+ ( _key , value ) => {
362
+ switch ( value ) {
363
+ case true :
364
+ return '$$__TRUE__$$' ;
365
+ case false :
366
+ return '$$__FALSE__$$' ;
367
+ case null :
368
+ return '$$__NULL__$$' ;
369
+ default :
370
+ return value ;
371
+ }
372
+ } ,
373
+ 2
374
+ )
371
375
. replaceAll ( '"$$__TRUE__$$"' , 'True' )
372
376
. replaceAll ( '"$$__FALSE__$$"' , 'False' )
373
377
. replaceAll ( '"$$__NULL__$$"' , 'None' ) ;
You can’t perform that action at this time.
0 commit comments