File tree 1 file changed +4
-5
lines changed
packages/insomnia/src/utils/importers/importers 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -270,12 +270,11 @@ const importFolderItem = (parentId: string) => (
270
270
} ;
271
271
272
272
/**
273
- * Return path with parameters replaced by insomnia variables
273
+ * Return path with parameters replaced by insomnia path parameters
274
274
*
275
- * I.e. "/foo/: bar" => "/foo/{{ bar }} "
275
+ * I.e. "/foo/{ bar} " => "/foo/: bar"
276
276
*/
277
- const pathWithParamsAsVariables = ( path ?: string ) =>
278
- path ?. replace ( VARIABLE_SEARCH_VALUE , '{{ _.$1 }}' ) ?? '' ;
277
+ const pathWithParamsAsPathParameters = ( path ?: string ) => path ?. replace ( VARIABLE_SEARCH_VALUE , ':$1' ) ?? '' ;
279
278
280
279
/**
281
280
* Return Insomnia request
@@ -301,7 +300,7 @@ const importRequest = (
301
300
parentId : parentId ,
302
301
name,
303
302
method : endpointSchema . method ?. toUpperCase ( ) ,
304
- url : `{{ _.base_url }}${ pathWithParamsAsVariables ( endpointSchema . path ) } ` ,
303
+ url : `{{ _.base_url }}${ pathWithParamsAsPathParameters ( endpointSchema . path ) } ` ,
305
304
body : body ,
306
305
description : endpointSchema . description || '' ,
307
306
headers : [ ...paramHeaders , ...securityHeaders ] ,
You can’t perform that action at this time.
0 commit comments