Fix nested XML model element name precedence - #5204
Fix nested XML model element name precedence#5204Chenjie Shi (tadelesh) wants to merge 12 commits into
Conversation
Preserve property-provided XML element names while retaining custom model names for root serialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
|
All changed packages have been documented.
Show changes
|
📦 Package size report2 packages changed size, +565 B (+0.0%) packed overall.
11 package(s) with no notable change
Packed = gzipped |
Go emitter diffBaseline Diff summary: 8 file(s), +476 / -38 Rendered diff: inline on the run summary, or the emitter-diff-go-html artifact. Informational check (core/eng/emitter-diff); does not block the PR. |
commit: |
|
You can try these changes here
|
Move custom model XML naming to context-aware request and fake response roots while preserving property-provided element names in model marshallers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Emit the shared XML root wrapper once in an existing generated client file instead of creating a dedicated source generator and Go file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Generate the XML root wrapper in the existing XML helper file alongside additional-properties support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Keep the existing XML additional-properties generator and emitter plumbing while extending its generated helper file with root serialization support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Use the general xml-helpers name now that the generator emits both root and additional-properties helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Resolve the request-handler conflict by retaining context-aware XML root wrapping in the refactored emitBody path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2fed377-7b26-45fc-b3aa-8b6d6df8b46a
|
Joel Hendrix (@jhendrixMSFT) I've tried several solutions to handle different naming of root usage vs nested usage for a model. The current one is more general. What do you think? |
|
IMO we need to retool how we model XML info. There were some cases between Autorest and tsp that were different leading to some awkward code. Now that we don't have to share anything with Autorest we can retool it. |
Joel Hendrix (jhendrixMSFT)
left a comment
There was a problem hiding this comment.
Will retool XML modeling now that autorest is out of the picture.
Also, will wait until after storage tsp migration has landed.
Summary
MarshalXMLmethods apply custom model XML names for direct/root serializationTesting
@azure-tools/typespec-goazblobandpayload/xmlpayload/xmlSpector Go module uncached, including wrapped and unwrapped model arraysFixes #5179