Repository navigation
fix(http-client-java): make YAML deserialization context-aware - #12434
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: 60868175-cb81-4b72-83af-4b789c536100
Co-authored-by: Copilot <[email protected]> Copilot-Session: 60868175-cb81-4b72-83af-4b789c536100
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the context-aware YAML deserialization change.
No open issues 🎉
What changed in this PR
Makes the Java generator’s code-model YAML deserialization context-aware, preventing service-defined keys such as discriminator value responses from being mistaken for structural properties.
Changes:
- Restricts structural preprocessing to the owning model classes, leaving typed-map keys and example payloads untouched.
- Adds regression tests for special-key collisions, schema types, and alias identity.
- Adds a Java emitter bug-fix changelog entry.
| File | Description |
|---|---|
packages/http-client-java/generator/http-client-generator-core/src/test/java/com/microsoft/typespec/http/client/generator/core/extension/model/codemodel/CodeModelCustomConstructorTests.java |
Tests key collisions, payload preservation, schema types, and aliases. |
packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/model/codemodel/CodeModelCustomConstructor.java |
Scopes YAML preprocessing to owning beans and handles examples separately. |
.chronus/changes/http-client-java-context-aware-yaml-reader.md |
Documents the service-defined map-key fix. |
Review effort: Balanced
|
All changed packages have been documented.
Show changes
|
…ressions Co-authored-by: Copilot <[email protected]> Copilot-Session: 60868175-cb81-4b72-83af-4b789c536100
|
You can try these changes here
|
|
The regression combines two changes/conditions:
The emitter change exposed an existing reader defect; different TCGC output is not required to explain the regression. #12428 guarded This PR limits structural preprocessing to the owning Java beans, leaving dictionary keys untouched. |
…es (#5900) ## Summary - sync Java generator to core `6ba281975` - fix YAML structural-key collisions (microsoft/typespec#12434) - preserve ARM resource ID parameters for shared-model routes (microsoft/typespec#12443) - sync regression fixtures and tests; retain version 0.48.4 for a separate publish PR ## Validation - emitter/generator build and client regeneration - all 7 generated-client resource ID parsing regressions pass - Chronus verification, formatting, and lint The earlier SDK sync run 7018297 timed out at 120 minutes; it has not been rerun for this update. --------- Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
Summary
Make Java code-model YAML deserialization context-aware: preprocess structural properties only on their owning beans, leaving typed-map keys and example payloads untouched.
Extends #12428 to address collisions such as discriminator value
responses, reported in Azure/azure-sdk-for-java#50875. Retains the existing tests and adds coverage for all special keys, other typed maps, schema types, and aliases.Adds a permanent TypeSpec regression to
discriminator-edge-cases.tspcoveringall,immediate,responses, andexceptions.Validation
mvn verify, 53 emitter tests, build, formatting, and lint passed.