Skip to content

fix(domain): comma-join repeatable TLD flags before sending as query params (DEVEX-882)#106

Merged
jpage-godaddy merged 2 commits into
rust-portfrom
multi-tld-bug
Jul 15, 2026
Merged

fix(domain): comma-join repeatable TLD flags before sending as query params (DEVEX-882)#106
jpage-godaddy merged 2 commits into
rust-portfrom
multi-tld-bug

Conversation

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

Summary

  • gddy domain suggest --tlds and gddy domain agreements --tld sent repeated occurrences as separate tlds= query pairs (tlds=com&tlds=net&tlds=io), which the Domains API rejects (400 MISMATCH_FORMAT).
  • The OpenAPI spec correctly declares tlds as style: form, explode: false (one comma-joined value), but progenitor's generated client always seq-serializes Vec query params as repeated pairs regardless of explode — this is a known, acknowledged upstream limitation (see oxidecomputer/progenitor#1017, #724).
  • Added a comma_joined() helper in domain::common and applied it at both call sites so multiple --tlds/--tld values are joined into the single query value the API expects.

Test plan

  • New regression tests (httpmock-based) assert the wire-level query string is tlds=com,net,io, not repeated pairs, for both domain suggest and domain agreements.
  • New unit tests for comma_joined (multi-value, single-value, empty).
  • cargo test --workspace passes.
  • cargo clippy --all-targets -- -D warnings clean.

Fixes DEVEX-882.

🤖 Generated with Claude Code

…params (DEVEX-882)

progenitor's generated client always seq-serializes a Vec query-param setter
as repeated key=value pairs, ignoring the OpenAPI spec's `style: form,
explode: false` for `tlds`. Multiple --tlds/--tld occurrences on `domain
suggest` and `domain agreements` were sent as tlds=com&tlds=net&tlds=io
instead of tlds=com,net,io, which the API rejects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Domains API request formatting for repeatable TLD flags by ensuring tlds is sent as a single comma-joined query parameter (OpenAPI style: form, explode: false), working around progenitor’s current query serialization behavior.

Changes:

  • Added comma_joined() helper to collapse repeatable flag values into a single comma-joined query value.
  • Applied comma_joined() to domain suggest --tlds and domain agreements --tld request builders.
  • Added regression tests (httpmock-based) to assert the wire-level query string format, plus unit tests for comma_joined().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
rust/src/domain/common.rs Adds comma_joined() helper and unit tests to enforce correct list-to-query serialization.
rust/src/domain/suggest.rs Uses comma_joined() for tlds and adds a regression test verifying the query param is comma-joined.
rust/src/domain/agreements.rs Uses comma_joined() for tlds and adds a regression test verifying the query param is comma-joined.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/src/domain/common.rs
…lues

Address Copilot review feedback on #106: values.join(",") always allocates
a new String even for the single-element case. Return the Vec unchanged
when there's nothing to join.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@jpage-godaddy jpage-godaddy merged commit ada4a93 into rust-port Jul 15, 2026
2 checks passed
@jpage-godaddy jpage-godaddy deleted the multi-tld-bug branch July 15, 2026 15:59
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