Skip to content

Conversation

@fern-support
Copy link
Collaborator

We're updating Merge's code so that users can pass a list of strings as query parameters. The logic in this PR will convert the list of strings to a comma separated string of all the query parameters.

@windsurf-bot
Copy link

windsurf-bot bot commented May 23, 2025

I ran into an unexpected issue while reviewing this PR. Please try again later.

Comment on lines +25 to +46
// In cases where valueNode is a list of strings, we want to return a comma separated string
if (key.equals("expand")) {
String commaSeparatedQueryParams = "";

if (valueNode.isArray()) {
List<String> values = new ArrayList<>();
for (JsonNode node : valueNode) {
values.add(node.asText());
}
commaSeparatedQueryParams = String.join(",", values);
} else if (value instanceof String) {
String text = ((String) value).trim();
if (text.startsWith("[") && text.endsWith("]")) {
commaSeparatedQueryParams = text.replace("[", "").replace("]", "").replace(", ", ",");
}
}

if (commaSeparatedQueryParams.length() > 0) {
httpUrl.addQueryParameter(key, commaSeparatedQueryParams);
return;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsinghvi here's the logic to look at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants