File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
generators/python-v2/sdk/src/wire-tests Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,18 @@ export class WireTestGenerator {
328328 if ( example . queryParameters ) {
329329 for ( const [ key , value ] of Object . entries ( example . queryParameters ) ) {
330330 if ( value != null ) {
331- queryParams . push ( [ key , this . formatValue ( value ) ] ) ;
331+ const queryParameterDeclaration = endpoint . queryParameters . find (
332+ ( queryParameter ) => queryParameter . name . wireValue === key
333+ ) ;
334+ if ( queryParameterDeclaration != null ) {
335+ // Use the safe name to avoid collisions with reserved keywords
336+ queryParams . push ( [
337+ queryParameterDeclaration . name . name . snakeCase . safeName ,
338+ this . formatValue ( value )
339+ ] ) ;
340+ } else {
341+ queryParams . push ( [ key , this . formatValue ( value ) ] ) ;
342+ }
332343 }
333344 }
334345 }
You can’t perform that action at this time.
0 commit comments