Add missing scenarios for xml handling#10063
Merged
timotheeguerin merged 4 commits intoMar 18, 2026
Merged
Conversation
commit: |
timotheeguerin
commented
Mar 17, 2026
Contributor
|
All changed packages have been documented.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Expands the payload/xml HTTP specs to cover additional XML serialization scenarios (renaming, nested models, array wrapping/unwrapping variants, attributes, and namespaces) and wires them into the mock server so Spector scenarios can be executed end-to-end.
Changes:
- Added new XML payload fixtures and scenario handlers in the mock API for additional XML shapes.
- Extended the TypeSpec spec with new models and scenario interfaces covering renaming, nesting, array wrapping/unwrapping, attributes, and namespaces.
- Refactored model documentation from
@doc(...)decorators to TypeSpec doc comments (/** ... */) and regrouped shared types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/http-specs/specs/payload/xml/mockapi.ts | Adds XML example strings and registers corresponding GET/PUT mock scenario handlers for the new routes. |
| packages/http-specs/specs/payload/xml/main.tsp | Adds new XML models + scenario interfaces (routes) to exercise additional XML mapping behaviors, including namespaces and renamed elements/attributes. |
You can also share your feedback on Copilot code review. Take the survey.
Collaborator
|
You can try these changes here
|
markcowl
approved these changes
Mar 18, 2026
Merged
15 tasks
Copilot AI
added a commit
that referenced
this pull request
Mar 19, 2026
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
…XML serialization bugs (#10098) - [x] Bump @typespec/http-specs to 0.1.0-alpha.35 - [x] Add 11 new XML scenario tests (sync + async) - [x] Fix unwrapped model array element naming - [x] Fix namespace key mismatch (DPG "namespace" vs runtime "ns") - [x] Fix default-namespace propagation semantics - [x] Fix Python ET reserved prefix (ns\d+) - [x] Remove all 4 @pytest.mark.skip markers — 26/26 tests pass - [x] Update changelog entry to reflect generator fixes and all-green tests - [x] Fix `itemNs` → `itemsNs` key mismatch in deserialization (red bug) - [x] Replace all `or` chains for namespace lookups with `is None` checks (handles empty-string namespaces correctly) - [x] Add note about `ET._namespace_map` silent fallback behavior - [x] Remove `.venv_test` from `.gitignore` (local dev leftover) - [x] Extract `_get_xml_ns` helper to eliminate 9x duplicated ns/namespace fallback pattern - [x] Merge main branch, resolve conflicts using main's dependency versions - [x] Fix mypy `Optional[Any]` type error in unwrapped array deserialization block <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[python] add test case for #10063 > </issue_title> > <issue_description>follow skill https://github.com/microsoft/typespec/blob/main/.github/skills/python-sdk-spector-mock-api-tests/SKILL.md to write test case for #10063 > </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #10097 <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: iscai-msft <isabellavcai@gmail.com>
msyyc
added a commit
that referenced
this pull request
Apr 1, 2026
…XML serialization bugs (#10098) - [x] Bump @typespec/http-specs to 0.1.0-alpha.35 - [x] Add 11 new XML scenario tests (sync + async) - [x] Fix unwrapped model array element naming - [x] Fix namespace key mismatch (DPG "namespace" vs runtime "ns") - [x] Fix default-namespace propagation semantics - [x] Fix Python ET reserved prefix (ns\d+) - [x] Remove all 4 @pytest.mark.skip markers — 26/26 tests pass - [x] Update changelog entry to reflect generator fixes and all-green tests - [x] Fix `itemNs` → `itemsNs` key mismatch in deserialization (red bug) - [x] Replace all `or` chains for namespace lookups with `is None` checks (handles empty-string namespaces correctly) - [x] Add note about `ET._namespace_map` silent fallback behavior - [x] Remove `.venv_test` from `.gitignore` (local dev leftover) - [x] Extract `_get_xml_ns` helper to eliminate 9x duplicated ns/namespace fallback pattern - [x] Merge main branch, resolve conflicts using main's dependency versions - [x] Fix mypy `Optional[Any]` type error in unwrapped array deserialization block <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[python] add test case for #10063 > </issue_title> > <issue_description>follow skill https://github.com/microsoft/typespec/blob/main/.github/skills/python-sdk-spector-mock-api-tests/SKILL.md to write test case for #10063 > </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #10097 <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: iscai-msft <isabellavcai@gmail.com>
github-merge-queue Bot
pushed a commit
to Azure/typespec-azure
that referenced
this pull request
Apr 1, 2026
## Summary Categorizes 78 test scenarios as **Backlog** in the Can I Use dashboard based on cross-language analysis of skipped tests across Go, Java, Python, and JS emitters. **Criterion**: A scenario is moved to Backlog if it is skipped by **2 or more** of the 4 major language emitters, indicating the feature is optional rather than a single-emitter gap. Newly added scenarios that fit an existing Backlog category are also included. ### Data Sources | Language | Source | |----------|--------| | Go | [autorest.go#1812 comment](Azure/autorest.go#1812 (comment)) | | Python | [autorest.python#3372](Azure/autorest.python#3372) | | Java | \java-skipped.txt\ in repo root | | JS | \js-skipped.txt\ in repo root | ### Scenarios Added to Backlog (78 tests, skipped by 2+ languages) | Category | Tests | Languages Skipping | |----------|-------|--------------------| | Routes Path/Query Parameter Expansion | 32 | Go, Java, Python | | Type Union Discriminated | 8 | Go, Java, Python | | Pageable ContinuationToken | 6 | Go, Java, JS | | Pageable AlternateInitialVerb | 1 | New ([microsoft/typespec#9966](microsoft/typespec#9966)); no language implemented yet | | Azure AlternateType ExternalType | 4 | Go, Python, JS | | Azure ClientDefaultValue | 4 | Go, Java | | Authentication Noauth Union | 2 | Go, JS | | Pageable Link-based pagination | 3 | Java, JS | | Pageable PageSize | 2 | Java, JS | | Pageable XmlPagination | 2 | Go, Java | | Response StatusCodeRange | 2 | Go, JS | | Type File Body | 8 | Python, JS | | Encode Duration float*LargerUnit | 4 | Python, JS | | **Total** | **78** | | ### New XML scenarios kept as Core 22 new XML scenarios from [microsoft/typespec#10063](microsoft/typespec#10063) remain **Core**. Existing \Payload_Xml_*\ tests are only skipped by Java (1 language) — Go, Python, and JS pass them — so XML is an emitter-specific gap, not an optional feature. --- ### Scenarios Remaining in Core (~147 skipped tests kept as Core) Tests skipped by only 1 language remain Core — 3 of 4 emitters already support them, so these are emitter-specific gaps, not optional features. #### Go-only skips (~86 tests) — mostly blocked on union support | Category | Count | Reason | |----------|-------|--------| | Type_Union (non-discriminated) | 20 | Requires union support | | Type_Property_AdditionalProperties (union-related) | 34 | Requires union support | | Encode_Array | 12 | Tracked in [autorest.go#1771](Azure/autorest.go#1771) | | Type_Model_Inheritance_NestedDiscriminator | 6 | Not a real scenario — will fix on demand | | Versioning (Added/Removed/RenamedFrom) | 9 | Requires union support | | Authentication_Union | 2 | Requires union support | | SpecialHeaders_Repeatability | 1 | Requires union support | | DeserializeEmptyStringAsNull | 1 | Tracked in [autorest.go#1857](Azure/autorest.go#1857) | | Azure_Core_Page_withParameterizedNextLink | 1 | Tracked in [autorest.go#1576](Azure/autorest.go#1576) | > Go's gaps are primarily due to missing union support. Once Go adds unions, ~66 of these tests will pass. #### Python-only skips (~33 tests) — feature-specific gaps | Category | Count | Reason | |----------|-------|--------| | Encode_Duration (int/non-float variants) | 20 | No urgent demand for these encodings | | ClientInitialization (Individually*) | 13 | Feature not yet needed by Python | > Java, Go, and JS support these. Python's gaps are implementation priorities, not optional features. #### Java-only skips (~28 tests) — XML and misc | Category | Count | Reason | |----------|-------|--------| | Payload_Xml | 26 | XML support incomplete | | Parameters_Path_optional | 1 | Not yet implemented | | Resiliency_ServiceDriven_breakTheGlass | 1 | Not yet implemented | > Go, Python, and JS support these. XML is a real Azure feature used by services like Storage. #### JS-only skips (0 tests) All JS-skipped tests overlapped with at least one other language, so they all moved to Backlog. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
And reorganize/add mapping to the guide