Repeated Field Names in Web Inputs
A form or query can supply several values under one name. A receiver needs a defined policy for single-value fields and lists.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a filter example
A tag filter might receive history and systems as two values. An application can include both, reject the repetition, or apply another documented rule, depending on the field's meaning. Dictionary values explain what a single-value representation might lose.
Check absence separately
Zero tag values can mean no filter, while one empty value may be invalid or meaningful. A function contract lets parsing and business validation agree.[1][2]
Read repeated parameters as a sequence when the interface allows it
A search URL can have tag=rail&tag=maps. Reading only one value might silently discard a selected filter. A multivalue parser can expose both and then apply the documented any-match or all-match rule. See form submission pairs.
Received tag values: ["rail", "maps"]
any-match: rail or maps suffices
all-match: both required
Single-value fields can reject duplication explicitly
Keep deduplication and input order deliberate
Repeated identical values may be equivalent for a set-like filter. An ordered choice field can care about order instead. Test zero, one and two distinct values and verify the effective filter reflected in the response.