File tree 1 file changed +12
-5
lines changed
packages/fdr-sdk/src/api-definition/snippets
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -90,10 +90,6 @@ function getBodyJsonString(
90
90
value : unknown | null | undefined ,
91
91
protocol ?: Latest . Protocol
92
92
) : string [ ] {
93
- if ( value == null ) {
94
- return [ ] ;
95
- }
96
-
97
93
if ( protocol ?. type === "openrpc" ) {
98
94
const payload = {
99
95
id : 1 ,
@@ -108,6 +104,10 @@ function getBodyJsonString(
108
104
return [ `-d '${ stringifiedValue } '` ] ;
109
105
}
110
106
107
+ if ( value == null ) {
108
+ return [ ] ;
109
+ }
110
+
111
111
if ( typeof value === "string" ) {
112
112
return [ `-d "${ value . replace ( / " / g, '\\"' ) } "` ] ;
113
113
}
@@ -211,7 +211,14 @@ function getBodyDataString(
211
211
usesApplicationJsonInFormDataValue : boolean ,
212
212
protocol : Latest . Protocol | undefined
213
213
) : string [ ] {
214
- if ( method === "GET" || body == null ) {
214
+ if ( method === "GET" ) {
215
+ return [ ] ;
216
+ }
217
+
218
+ if ( body == null ) {
219
+ if ( protocol ?. type === "openrpc" ) {
220
+ getBodyJsonString ( undefined , protocol ) ;
221
+ }
215
222
return [ ] ;
216
223
}
217
224
You can’t perform that action at this time.
0 commit comments