pulumi / pulumi/pulumi-java

Discriminated unions collapse to Object; const tags are not pre-filled; output deserialization casts by shape

Open
#2,266 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/codegen area/sdks impact/usability language/java pulumi/pulumi-java
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

Mirrors pulumi/pulumi-dotnet#1098 for Java:

  1. Union-typed slots render as Object; any value compiles.
  2. Const-tagged discriminator properties are user-supplied builder arguments (.__type("PermissionExpressionAnd")) rather than pre-filled from the schema const.
  3. Converter.tryConvertOneOf uses canBeCast, 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.