mirror of
https://github.com/foss42/apidash.git
synced 2025-06-05 19:14:25 +08:00
[ISSUE 375] - query params rendered through iteration in jinja template
This commit is contained in:
@ -131,20 +131,10 @@ echo $response;
|
||||
|
||||
//checking and adding query params
|
||||
if (uri.hasQuery) {
|
||||
var params = uri.queryParameters;
|
||||
if (params.isNotEmpty) {
|
||||
if (requestModel.enabledParamsMap.isNotEmpty) {
|
||||
hasQuery = true;
|
||||
var templateParams = jj.Template(kTemplateParams);
|
||||
|
||||
// generating the map of key and value for the query parameters
|
||||
List<String> queryList = [];
|
||||
for (MapEntry<String, String> entry in params.entries) {
|
||||
String entryStr = "\"${entry.key}\" => \"${entry.value}\"";
|
||||
queryList.add(entryStr);
|
||||
}
|
||||
String paramsString = "\n ${queryList.join(",\n ")}\n";
|
||||
|
||||
result += templateParams.render({"params": paramsString});
|
||||
result += templateParams.render({"params": requestModel.enabledParamsMap});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user