Skip to content

Add multi_value_param_names option and rewrite README#9

Merged
daichirata merged 1 commit into
masterfrom
multi-value-param-names
May 22, 2026
Merged

Add multi_value_param_names option and rewrite README#9
daichirata merged 1 commit into
masterfrom
multi-value-param-names

Conversation

@daichirata

Copy link
Copy Markdown
Owner

Closes #7

Summary

  • Add multi_value_param_names to query_string_parser so users can promote only listed parameters to arrays, instead of forcing every parameter into an array via multi_value_params true
  • multi_value_params true keeps precedence when both are set, so existing configurations are unaffected
  • Rewrite the README with input → output examples for every option and a single options table

Behavior

Config Input Output
(none) tag=ruby&tag=fluentd&lang=ja { "tag": "fluentd", "lang": "ja" } (last wins)
multi_value_params true same { "tag": ["ruby", "fluentd"], "lang": ["ja"] }
multi_value_param_names tag same { "tag": ["ruby", "fluentd"], "lang": "ja" }

Test plan

  • bundle exec rake test (20 tests / 87 assertions / 0 failures)
  • Added tests covering: single-name array, multi-name with single-occurrence values still wrapped, multi_value_params precedence over multi_value_param_names
  • GitHub Actions matrix passes on Ruby 3.2 / 3.3 / 3.4 / 4.0

🤖 Generated with Claude Code

Adds a new optional setting `multi_value_param_names` to
`query_string_parser` that emits only the listed parameter names as
arrays, leaving the rest as scalars. This is more ergonomic than the
all-or-nothing `multi_value_params true` when only a few keys are
known to repeat. `multi_value_params` takes precedence when both are
set so existing behavior is preserved.

The README is also rewritten with input → output examples for each
option, an overview of what the plugins do, and a single options table.

Closes #7

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@daichirata daichirata merged commit 4cf8f40 into master May 22, 2026
4 checks passed
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.

Use array only if parameter was sent multiple times

1 participant