Skip to content

[http-specs] Add explode object query parameter Spector scenario#11125

Merged
JoshLove-msft merged 3 commits into
microsoft:mainfrom
JoshLove-msft:jolov/query-explode-spector-tests
Jul 3, 2026
Merged

[http-specs] Add explode object query parameter Spector scenario#11125
JoshLove-msft merged 3 commits into
microsoft:mainfrom
JoshLove-msft:jolov/query-explode-spector-tests

Conversation

@JoshLove-msft

@JoshLove-msft JoshLove-msft commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Adds Spector coverage for the gap behind #11123 / #10973.

There was no Spector scenario exercising a complex/model-typed query parameter, so exploded-object query serialization was untested across emitters.

What

New @typespec/http-specs scenario Parameters_Query_Explode_object (GET /parameters/query/explode/object): a model-valued query parameter with @query(#{ explode: true }), which per RFC 6570 form explode expands each property into its own query entry (?field=status&value=active). Includes the regenerated spec-summary.md.

Validation

  • pnpm validate-scenarios, pnpm validate-mock-apis, and summary regen all pass.

Follow-ups

This PR contains only the shared spec scenario. Per-emitter tests come later:

The shared scenario also unblocks the JS emitter side (#10973).

@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:http-specs For issues/prs related to the @typespec/http-specs package emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Jul 1, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-specs@11125

commit: 225c497

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - feature ✏️

Add Routes_QueryParameters_QueryExpansion_Explode_model scenario covering a named model-valued query parameter with explode expansion ({?param*}), which per RFC 6570 form explode expands each property into its own query entry (?field=status&value=active).

Add a scenario (Parameters_Query_Explode_object) covering a model-valued query
parameter with \@query(#{ explode: true })\, which per RFC 6570 form explode
expands each property into its own query entry (\?field=status&value=active\).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JoshLove-msft JoshLove-msft force-pushed the jolov/query-explode-spector-tests branch from 7033804 to 0f208f3 Compare July 1, 2026 02:57
@JoshLove-msft JoshLove-msft changed the title [http-specs] Add explode object query parameter Spector scenario and C# test [http-specs] Add explode object query parameter Spector scenario Jul 1, 2026
@azure-sdk-automation

azure-sdk-automation Bot commented Jul 1, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@JoshLove-msft JoshLove-msft force-pushed the jolov/query-explode-spector-tests branch from 30a52f2 to 15a1a9c Compare July 1, 2026 03:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@weidongxu-microsoft weidongxu-microsoft 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.

Approved. The scenario correctly models RFC 6570 form-style query expansion with explode ({?keys*}, §3.2.9): an object-valued query parameter with @query(#{ explode: true }) expands each property into its own
ame=value entry using the property name as the key (?field=status&value=active), with the parameter name itself dropped.

@JoshLove-msft JoshLove-msft enabled auto-merge July 1, 2026 03:32
Comment thread packages/http-specs/specs/parameters/query/main.tsp
Address PR feedback: relocate the exploded model-valued query parameter scenario from parameters/query into the routes query-expansion/explode section alongside the existing primitive/array/record cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread packages/http-specs/specs/routes/main.tsp
Merged via the queue into microsoft:main with commit bd2c0d7 Jul 3, 2026
32 of 33 checks passed
@JoshLove-msft JoshLove-msft deleted the jolov/query-explode-spector-tests branch July 3, 2026 16:24
tadelesh pushed a commit that referenced this pull request Jul 9, 2026
)

Adds Spector coverage for the gap behind #11123 / #10973.

There was **no** Spector scenario exercising a complex/model-typed query
parameter, so exploded-object query serialization was untested across
emitters.

## What

New `@typespec/http-specs` scenario `Parameters_Query_Explode_object`
(`GET /parameters/query/explode/object`): a model-valued query parameter
with `@query(#{ explode: true })`, which per RFC 6570 form explode
expands each property into its own query entry
(`?field=status&value=active`). Includes the regenerated
`spec-summary.md`.

## Validation

- `pnpm validate-scenarios`, `pnpm validate-mock-apis`, and summary
regen all pass.

## Follow-ups

This PR contains only the shared spec scenario. Per-emitter tests come
later:
- C# emitter fix: #11124
- C# Spector test + generated client: a follow-up PR (depends on
#11124).

The shared scenario also unblocks the JS emitter side (#10973).

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp lib:http-specs For issues/prs related to the @typespec/http-specs package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants