-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript union types are not correctly resolved in Java #3935
Comments
Hey! Thanks for reporting. That looks weird indeed... I'll need to come up with a jsii-level repro to clarify the situation here... |
Thank you! Just in case, I've created a repo reproducing the issue: https://github.com/RoKish/cdk-union-type-bug. |
Thanks for that - this is super helpful. This issue is actually pretty complex... There is a lack of runtime-available information and the jsii kernel (JS side) is doing its best here... The problem is while I can come up with a solution that possibly fixes this particular instance, a fix that solves the issue generally is a lot more difficult to achieve. Thinking though some of the options to make this a little nicer (basically, giving you as a user more control over what you can do), it appears the best way would be to surface some
|
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Issue is still present and makes parsing of manifest from Java not possible. From an ArtifactManifest object, the property To reproduce error:
Throws:
|
I'll mention here that we have an open RFC about the type unions problem => aws/aws-cdk-rfcs#193 |
This is a jsii issue so I'm moving this to that repo. |
In Typescript
CloudFormationStackArtifact#getAssets
returnsAssetMetadataEntry[]
, whereAssetMetadataEntry = FileAssetMetadataEntry | ContainerImageAssetMetadataEntry
.In Java this method returns a
List<Object>
, which is, actually, a list of JSII objects. The JSII objects are supposed to referenceFileAssetMetadataEntry
andContainerImageAssetMetadataEntry
objects from JSII runtime, however the reference type is alwaysFileAssetMetadataEntry
:The issue is also actual for
software.amazon.awscdk.cloudassembly.schema.MissingContext#getProps
. It is supposed to returnContextQueryProperties
which is a union type in Typescript, however, the JSII object reference is always of typeAmiContextQuery
(looks like it always takes the first type in the union type definition as bothFileAssetMetadataEntry
andAmiContextQuery
are defined first.Reproduction Steps
repositoryName
of the asset:Error Log
Environment
The text was updated successfully, but these errors were encountered: