Description
Construct ordered form fields from supplied strings and retain exact UTF-8 form encoder and decoder round-trip expectations.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Construct ordered form fields from supplied strings and retain exact UTF-8 form encoder and decoder round-trip expectations.
When to use this tool
Use this generator to create reproducible form urlencoded round trip corpus cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply names, values, pairCount, count in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read cases. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Draw ordered name/value pairs, delegate application/x-www-form-urlencoded encoding and decoding, and compare both decoded arrays with their originals. Return the encoded text, decoded pairs, and an explicit roundTrip flag.1
Delegated operations used for this result: form urlencoded encoder; form urlencoded decoder. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| names | Names | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 16. |
| values | Values | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 16. |
| pairCount | Pair Count | Required. Safe integer; minimum 1; maximum 16. |
| count | Count | Required. Safe integer; minimum 1; maximum 32. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| cases[].names | Names | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16. |
| cases[].values | Values | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16. |
| cases[].encoded | Encoded | Required. Text; maximum UTF-16 length 65536. |
| cases[].decodedNames | Decoded Names | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16. |
| cases[].decodedValues | Decoded Values | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16. |
| cases[].roundTrip | Round Trip | Required. Boolean. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"names": [
"q"
],
"values": [
"red apples",
"café"
],
"pairCount": 2,
"count": 1,
"seed": 42
},
"output": {
"cases": [
{
"names": [
"q",
"q"
],
"values": [
"red apples",
"café"
],
"encoded": "q=red+apples&q=caf%C3%A9",
"decodedNames": [
"q",
"q"
],
"decodedValues": [
"red apples",
"café"
],
"roundTrip": true
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Duplicate names remain ordered pairs rather than a last-wins object. Encoded-size budgets are checked conservatively. No form submission, request, charset negotiation, or server-side interpretation occurs.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Data Attribute Round-Trip Fixture Generator
Construct caller data-* names and escaped values with optional uppercase controls, comparing source and parsed name checks and raw lexical round trips without a DOM dataset claim.
- Random CSV Long and Wide Round-Trip Fixture Generator
Construct a complete entity/measure grid with planted duplicate observations, explicitly sum duplicates, reshape to fixed-header wide CSV and unpivot the aggregate answer using reviewed CSV converters.