-
Notifications
You must be signed in to change notification settings - Fork 4k
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
java (dotnet?) regression: unable to use structs with escape hatches #5066
Comments
@RomainMuller why do we need to even tag structs? Isn't the whole point for them to be passed as simple values? There shouldn't be a difference between a struct and a JSON object sent over the wire. |
The issue was when deserializing unions, a type hint was necessary in order to safely operate. There was a |
When a struct is serialized with a $jsii.struct decoration from a jsii host language and passed into a value typed `any`, the kernel ignored the decoration. This resulted in a malformed object passed to the javascript code. This fix undecorates the object and continues to deserialize it as `any`. Fixes aws/aws-cdk#5066
When a struct is serialized with a $jsii.struct decoration from a jsii host language and passed into a value typed any, the kernel ignored the decoration. This resulted in a malformed object passed to the javascript code. This fix undecorates the object and continues to deserialize it as a struct. Also, increase kernel unit test coverage for serialization and deserialization of "any". Fixes aws/aws-cdk#5066
Bug Fixes - java: handle null-able collections correctly (#986) (e88e5e2), closes #4316 - jsii: unable to depend on modules with private declarations (#995) (08c4294), closes #994 - kernel: cannot pass decorated structs to kernel as "any" (#997) (2bd3183), closes #5066 Features - jsii-config: introducing jsii-config (#981) (2bbf576), closes #904 - rosetta: extract and compile samples into "tablets" (#925) (eec44e1)
* feat: upgrade to jsii 0.20.7 Bug Fixes - java: handle null-able collections correctly (#986) (e88e5e2), closes #4316 - jsii: unable to depend on modules with private declarations (#995) (08c4294), closes #994 - kernel: cannot pass decorated structs to kernel as "any" (#997) (2bd3183), closes #5066 Features - jsii-config: introducing jsii-config (#981) (2bbf576), closes #904 - rosetta: extract and compile samples into "tablets" (#925) (eec44e1) * fix broken code * type a couple of more arrays * fix another untyped array * fix a couple more issues * another untyped array * more
* feat: upgrade to jsii 0.20.7 Bug Fixes - java: handle null-able collections correctly (#986) (e88e5e2), closes aws/aws-cdk#4316 - jsii: unable to depend on modules with private declarations (#995) (08c4294), closes #994 - kernel: cannot pass decorated structs to kernel as "any" (#997) (2bd3183), closes aws/aws-cdk#5066 Features - jsii-config: introducing jsii-config (#981) (2bbf576), closes #904 - rosetta: extract and compile samples into "tablets" (#925) (eec44e1) * fix broken code * type a couple of more arrays * fix another untyped array * fix a couple more issues * another untyped array * more
When passing in jsii generated structs to APIs that accept
Object
, the"$jsii.struct
marker is retained. This means that users are not able to use jsii structs, for example, in property overrides, which is a regression from a previous version.Reproduction Steps
Result is:
Expected:
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: