Skip to content

Fix: Support repeated query parameter keys in curl generation and request display#24

Open
volatilegg wants to merge 1 commit into
hautvfami:mainfrom
volatilegg:fix/curl-parameters-duplicated
Open

Fix: Support repeated query parameter keys in curl generation and request display#24
volatilegg wants to merge 1 commit into
hautvfami:mainfrom
volatilegg:fix/curl-parameters-duplicated

Conversation

@volatilegg

Copy link
Copy Markdown

Summary:

When query parameters contain repeated keys (e.g. ?tag=foo&tag=bar), Alice previously only captured the last value because Uri.queryParameters returns a Map<String, String> which overwrites duplicate keys.

Changes:

  • alice_dio_interceptor.dart: Use Uri.queryParametersAll instead of Uri.queryParameters to preserve all values for repeated keys. Single-value lists are flattened to plain strings for backward compatibility.
  • alice_http_call.dart: Update getCurlCommand() to detect List values in query parameters and expand them into repeated keys (key=a&key=b) instead of serializing the list as a single value.
  • alice_call_request_widget.dart: Update the query parameters UI to display each value on its own row when a key has multiple values. Removed stray print() statement.
  • alice_http_request.dart: Updated doc comment on queryParameters to clarify values can be String or List.

Example:

Before: curl ... '...?category=electronics' (only last value)

After: curl ... '...?category=electronics&category=books&category=toys' (all values)

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.

1 participant