Repository navigation
[http-client-python] Serialize named model query parameters - #12624
Draft
Libba Lawrence (l0lawrence) wants to merge 1 commit into
Draft
Libba Lawrence (l0lawrence) wants to merge 1 commit into
Libba Lawrence (l0lawrence) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
Contributor
Python emitter diffBaseline Diff summary: 223 file(s), +4316 / -8 Rendered diff: inline on the run summary, or the emitter-diff-html artifact. Informational check (eng/emitter-diff); does not block the PR. |
|
You can try these changes here
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix one coherent Core-tier standard HTTP scenario group: named-model query expansion.
Routes_QueryParameters_QueryExpansion_Standard_modelRoutes_QueryParameters_QueryExpansion_Explode_modelRoutes_QueryParameters_QueryContinuation_Standard_modelRoutes_QueryParameters_QueryContinuation_Explode_modelPreserve the query model's
explodeflag in the emitter and serialize its wire-name/value pairs rather than passing the generated mapping model through the legacy object serializer. Standard expansion joins individually URL-encoded keys and values with commas; exploded expansion emits separate query parameters. Optional missing properties are omitted, and false, zero, and empty strings are preserved.Adds synchronous and asynchronous Spector regressions for all four scenarios, plus focused serializer tests for escaping, falsy values, skip-encoding, and missing required input. No coverage metadata or existing expectations are changed.
Dashboard evidence and freshness
Discovery on 2026-11-19 used https://typespec.io/can-i-use/http/ and its deployed
/_astro/index.C7Pug40E.js, not the Azure Python emitter:coveragescontainer. It reads the generator index, first probesreports/<version>.json, then falls back toreports/<version>/standard.json. The legacy report for the indexed version was absent; the standard report was successfully obtained.@typespec/http-specs0.1.0-alpha.46, commite06f6b34fdad9d7f49bfc084a598b03c60684e9a.scenariosMetadata.packageNameis@typespec/http-specs; spec version 0.1.0-alpha.36, report date 2026-04-28, generator/spec commit07e6c7fb6a6f6c32583bdbabd7be8b8a17f58398. That historical commit is not available in this checkout or through the current microsoft/typespec commit endpoint.The starting checkout was
b317c506c01f3a7226ae34e1c1d59fdb5fe2ffa6, with Python emitter 0.40.1 and http-specs 0.1.0-alpha.46. The manifest'sroutes/main.tsplocation was inspected in the checkout, and the installed standard spec used for generation was verified byte-equivalent after newline normalization. The named-model scenarios were added on 2026-10-07, after the published report. Earlier boolean and duration leads already pass against the current emitter and were skipped.Open microsoft/typespec PRs and identifiable pending Python automation sessions were checked before selection; no overlapping named-model query fix was found.
Reproduction and fix
Generating the current routes SDK succeeds, but calling any of the four operations with the public
ExpandParameters(field="status", value="active")type failed before sending HTTP:The request builder previously called
_SERIALIZER.query("param", param, "ExpandParameters"); the emitter also discardedexplodefor non-array parameters. Both causes are fixed. The new Spector tests were run before implementation and all eight sync/async cases failed with that error.Checks
Run from the isolated automation worktree:
npm run buildandnpm run test:emitterinpackages/http-client-python: passed, 75 emitter tests.compile(NodeHost, ...)API using the local emitter andPYTHONPATH=generator: passed.test_query_model_serialization.py,test_content_type_optional_body.py,test_string_literals.py, and both sync/asynctest_routesfiles: 361 passed. The local harness redirected the route clients and fixture to this session's own standard Spector server on port 3107, leaving an existing port-3000 server untouched.npm run lint: passed (Oxlint and generator Pylint).npm run format,npm run format:check, and Black checks on the three changed Python test files: passed.?param=field,a%2Cb,value,c%26d; exploded?field=a%2Cb&value=c%26d.git diff --check: passed.Dependency setup initially encountered a test-tool feed error and the formatter needed its repository build dependencies; these were resolved before the passing checks above. No dependency manifests or lockfiles were changed.