Discriminated unions collapse to Object; const tags are not pre-filled; output deserialization casts by shape
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 85
- Forks
- 26
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 22
Description
Mirrors pulumi/pulumi-dotnet#1098 for Java:
- Union-typed slots render as
Object; any value compiles. - Const-tagged discriminator properties are user-supplied builder arguments (
.__type("PermissionExpressionAnd")) rather than pre-filled from the schema const. Converter.tryConvertOneOfusescanBeCast, which fails on Map values, instead of dispatching on the discriminator tag.
Anchors: l2-discriminated-union, l2-discriminated-union-many, l2-discriminated-union-internal (pulumi/pulumi#24213). #2021 tracks implementing the conformance harness; this issue tracks the codegen and runtime changes needed to pass it with typed output.
Producer context: pulumi/pulumi-pulumiservice#1025.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the code-generation paths associated with l2-discriminated-union, l2-discriminated-union-many, and l2-discriminated-union-internal, then inspect Converter.tryConvertOneOf and its canBeCast use. Compare the generated Java and runtime behavior with the referenced conformance anchors; done means typed union slots, schema-derived const tags, and discriminator-based output deserialization pass those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100