From e729f5d53311224b9b742d024dc4cdf768e24e48 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Aug 2021 02:07:20 -0700 Subject: [PATCH] fix(java): Disable covariants for java builder params (#2853) Fixes #2839 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- .all-contributorsrc | 10 + README.md | 21 +- packages/jsii-calc/lib/container-types.ts | 18 + packages/jsii-calc/lib/index.ts | 1 + packages/jsii-calc/test/assembly.jsii | 267 +++++++++- packages/jsii-pacmak/lib/targets/java.ts | 2 +- .../__snapshots__/target-dotnet.test.ts.snap | 214 ++++++++ .../__snapshots__/target-go.test.ts.snap | 108 +++++ .../__snapshots__/target-java.test.ts.snap | 459 ++++++++++++++++++ .../__snapshots__/target-python.test.ts.snap | 142 ++++++ .../test/__snapshots__/jsii-tree.test.ts.snap | 65 +++ .../test/__snapshots__/tree.test.ts.snap | 47 ++ .../__snapshots__/type-system.test.ts.snap | 1 + 13 files changed, 1333 insertions(+), 22 deletions(-) create mode 100644 packages/jsii-calc/lib/container-types.ts diff --git a/.all-contributorsrc b/.all-contributorsrc index 14e3236bd5..60cecaed36 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1177,6 +1177,16 @@ "contributions": [ "doc" ] + }, + { + "login": "Nycto", + "name": "James", + "avatar_url": "https://avatars.githubusercontent.com/u/30517?v=4", + "profile": "https://github.com/Nycto", + "contributions": [ + "bug", + "code" + ] } ], "repoType": "github", diff --git a/README.md b/README.md index 8d2048e705..390db90bdd 100644 --- a/README.md +++ b/README.md @@ -114,91 +114,92 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Hamza Assyad

🐛 💻 🤔 👀
Hari Pachuveetil

📝 📖
Hsing-Hui Hsu

💻 📖 🤔 👀 +
James

🐛 💻
James Kelley

🐛 -
James Mead

💻 +
James Mead

💻
James Siri

💻 🚧
Jason Del Ponte

🤔 👀
Jason Fulghum

🤔 📆 👀
Jerry Kindall

📖 🤔
Jimmy Gaussen

🤔
Johannes Weber

📖 -
Jon Steinich

🐛 🤔 💻 +
Jon Steinich

🐛 🤔 💻
Joseph Lawson

👀
Joseph Martin

🐛
Junix

🐛
Justin Taylor

🐛
Kyle Thomson

💻 👀
Leandro Padua

🐛 -
Liang Zhou

🐛 💻 +
Liang Zhou

🐛 💻
Maja S Bratseth

🐛
Marcos Diez

🐛
Mark Nielsen

💻
Matthew Bonig

🐛 📝
Matthew Pirocchi

💻 🤔 👀
Mike Lane

🐛 -
Mitch Garnaat

🐛 💻 🤔 👀 +
Mitch Garnaat

🐛 💻 🤔 👀
Mitchell Valine

🐛 💻 🤔 🚧 👀
Mohamad Soufan

📖
Neta Nir

💻 🤔 🚧 👀
Nick Lynch

🐛 💻 🚧 👀
Niranjan Jayakar

🐛 💻 🤔 🚧 👀
Noah Litov

💻 🚧 👀 -
PIDZ - Bart

🤔 +
PIDZ - Bart

🤔
Petr Kacer

🐛
Petra Barus

💻
Philip Cali

🤔
Quentin Loos

🤔
Raphael

🐛
Richard H Boyd

🐛 -
Rico Huijbers

🐛 💻 🤔 🚧 👀 +
Rico Huijbers

🐛 💻 🤔 🚧 👀
Romain Marcadier

🐛 💻 🎨 🤔 🚧 👀 📝
SADIK KUZU

👀
SK

🤔
Sam Fink

💻 👀
Sam Goodwin

👀
Sebastian Korfmann

🐛 💻 🤔 -
Shane Witbeck

🤔 +
Shane Witbeck

🤔
Shiv Lakshminarayan

💻 🚧 👀
Somaya

💻 🤔 🚧 👀
The Gitter Badger

💻 🚧
Thomas Poignant

🐛
Thomas Steinbach

🐛
Thorsten Hoeger

💻 -
Tim Wagner

🐛 🤔 +
Tim Wagner

🐛 🤔
Tobias Lidskog

💻
Ty Coghlan

🐛
Tyler van Hensbergen

🤔
Vlad Hrybok

🐛
Vladimir Shchur

🐛
Yan Zhulanow

💻 -
Yigong Liu

🐛 🤔 +
Yigong Liu

🐛 🤔
ajnarang

🤔
aniljava

💻
deccy-mcc

🐛
dependabot-preview[bot]

🐛 🚧
dependabot[bot]

🚧
dheffx

🐛 -
gregswdl

🐛 +
gregswdl

🐛
guyroberts21

📖
mattBrzezinski

📖
mergify[bot]

🚧 diff --git a/packages/jsii-calc/lib/container-types.ts b/packages/jsii-calc/lib/container-types.ts new file mode 100644 index 0000000000..707fd8a5cd --- /dev/null +++ b/packages/jsii-calc/lib/container-types.ts @@ -0,0 +1,18 @@ +export class ClassWithContainerTypes { + public constructor( + public readonly array: DummyObj[], + public readonly record: Record, + public readonly obj: { [key: string]: DummyObj }, + public readonly props?: ContainerProps, + ) {} +} + +export interface ContainerProps { + readonly arrayProp: DummyObj[]; + readonly recordProp: Record; + readonly objProp: { [key: string]: DummyObj }; +} + +export interface DummyObj { + readonly example: string; +} diff --git a/packages/jsii-calc/lib/index.ts b/packages/jsii-calc/lib/index.ts index 7011df8283..e66664ba2f 100644 --- a/packages/jsii-calc/lib/index.ts +++ b/packages/jsii-calc/lib/index.ts @@ -7,6 +7,7 @@ export * from './erasures'; export * from './nested-class'; export * from './stability'; export * from './submodules'; +export * from './container-types'; export * as submodule from './submodule'; export * as onlystatic from './only-static'; diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 92b1c24f41..104dca5c4d 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -214,25 +214,25 @@ "jsii-calc.module2530": { "locationInModule": { "filename": "lib/index.ts", - "line": 19 + "line": 20 } }, "jsii-calc.module2617": { "locationInModule": { "filename": "lib/index.ts", - "line": 15 + "line": 16 } }, "jsii-calc.module2647": { "locationInModule": { "filename": "lib/index.ts", - "line": 14 + "line": 15 } }, "jsii-calc.module2689": { "locationInModule": { "filename": "lib/index.ts", - "line": 16 + "line": 17 } }, "jsii-calc.module2689.methods": { @@ -262,7 +262,7 @@ "jsii-calc.module2692": { "locationInModule": { "filename": "lib/index.ts", - "line": 18 + "line": 19 } }, "jsii-calc.module2692.submodule1": { @@ -280,19 +280,19 @@ "jsii-calc.module2700": { "locationInModule": { "filename": "lib/index.ts", - "line": 20 + "line": 21 } }, "jsii-calc.module2702": { "locationInModule": { "filename": "lib/index.ts", - "line": 17 + "line": 18 } }, "jsii-calc.nodirect": { "locationInModule": { "filename": "lib/index.ts", - "line": 13 + "line": 14 } }, "jsii-calc.nodirect.sub1": { @@ -310,13 +310,13 @@ "jsii-calc.onlystatic": { "locationInModule": { "filename": "lib/index.ts", - "line": 12 + "line": 13 } }, "jsii-calc.submodule": { "locationInModule": { "filename": "lib/index.ts", - "line": 11 + "line": 12 }, "readme": { "markdown": "Read you, read me\n=================\n\nThis is the readme of the `jsii-calc.submodule` module.\n" @@ -2487,6 +2487,144 @@ } ] }, + "jsii-calc.ClassWithContainerTypes": { + "assembly": "jsii-calc", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.ClassWithContainerTypes", + "initializer": { + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 2 + }, + "parameters": [ + { + "name": "array", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "array" + } + } + }, + { + "name": "record", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + }, + { + "name": "obj", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + }, + { + "name": "props", + "optional": true, + "type": { + "fqn": "jsii-calc.ContainerProps" + } + } + ] + }, + "kind": "class", + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 1 + }, + "name": "ClassWithContainerTypes", + "properties": [ + { + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 3 + }, + "name": "array", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "array" + } + } + }, + { + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 5 + }, + "name": "obj", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + }, + { + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 4 + }, + "name": "record", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + }, + { + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 6 + }, + "name": "props", + "optional": true, + "type": { + "fqn": "jsii-calc.ContainerProps" + } + } + ] + }, "jsii-calc.ClassWithDocs": { "assembly": "jsii-calc", "docs": { @@ -3355,6 +3493,82 @@ ], "name": "ConsumersOfThisCrazyTypeSystem" }, + "jsii-calc.ContainerProps": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.ContainerProps", + "kind": "interface", + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 10 + }, + "name": "ContainerProps", + "properties": [ + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 11 + }, + "name": "arrayProp", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "array" + } + } + }, + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 13 + }, + "name": "objProp", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + }, + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 12 + }, + "name": "recordProp", + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.DummyObj" + }, + "kind": "map" + } + } + } + ] + }, "jsii-calc.DataRenderer": { "assembly": "jsii-calc", "docs": { @@ -4489,6 +4703,37 @@ ], "name": "DoubleTrouble" }, + "jsii-calc.DummyObj": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.DummyObj", + "kind": "interface", + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 16 + }, + "name": "DummyObj", + "properties": [ + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/container-types.ts", + "line": 17 + }, + "name": "example", + "type": { + "primitive": "string" + } + } + ] + }, "jsii-calc.DynamicPropertyBearer": { "assembly": "jsii-calc", "docs": { @@ -16135,5 +16380,5 @@ } }, "version": "3.20.120", - "fingerprint": "Ouku0wagXKUVN9v9Ud7ocXYRaRl10KuCazRDvU/7iNk=" + "fingerprint": "nOY2or+a7JI7VfNfWx2VObkcBa28orXzx4J7PxiymbM=" } diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index 154ed3dd75..5d5df9680d 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -1709,7 +1709,7 @@ class JavaGenerator extends Generator { fieldName: this.code.toCamelCase( JavaGenerator.safeJavaPropertyName(param.name), ), - javaType: this.toJavaType(param.type, { covariant: true }), + javaType: this.toJavaType(param.type), })); const builtType = this.toJavaType(cls); diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap index a0534ff380..fbb599d21d 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap @@ -2734,6 +2734,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ClassThatImplementsTheInternalInterface.cs ┃ ┣━ 📄 ClassThatImplementsThePrivateInterface.cs ┃ ┣━ 📄 ClassWithCollections.cs + ┃ ┣━ 📄 ClassWithContainerTypes.cs ┃ ┣━ 📄 ClassWithDocs.cs ┃ ┣━ 📄 ClassWithJavaReservedWords.cs ┃ ┣━ 📄 ClassWithMutableObjectLiteralProperty.cs @@ -2747,6 +2748,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ConsumePureInterface.cs ┃ ┣━ 📄 ConsumerCanRingBell.cs ┃ ┣━ 📄 ConsumersOfThisCrazyTypeSystem.cs + ┃ ┣━ 📄 ContainerProps.cs ┃ ┣━ 📄 DataRenderer.cs ┃ ┣━ 📄 Default.cs ┃ ┣━ 📄 DefaultedConstructorArgument.cs @@ -2769,6 +2771,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 DoNotRecognizeAnyAsOptional.cs ┃ ┣━ 📄 DontComplainAboutVariadicAfterOptional.cs ┃ ┣━ 📄 DoubleTrouble.cs + ┃ ┣━ 📄 DummyObj.cs ┃ ┣━ 📄 DynamicPropertyBearer.cs ┃ ┣━ 📄 DynamicPropertyBearerChild.cs ┃ ┣━ 📄 Entropy.cs @@ -2795,6 +2798,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IChildStruct982.cs ┃ ┣━ 📄 IConcreteBellRinger.cs ┃ ┣━ 📄 IConfusingToJacksonStruct.cs + ┃ ┣━ 📄 IContainerProps.cs ┃ ┣━ 📄 IDeprecatedInterface.cs ┃ ┣━ 📄 IDeprecatedStruct.cs ┃ ┣━ 📄 IDerivedStruct.cs @@ -2803,6 +2807,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IDiamondInheritanceFirstMidLevelStruct.cs ┃ ┣━ 📄 IDiamondInheritanceSecondMidLevelStruct.cs ┃ ┣━ 📄 IDiamondInheritanceTopLevelStruct.cs + ┃ ┣━ 📄 IDummyObj.cs ┃ ┣━ 📄 IEraseUndefinedHashValuesOptions.cs ┃ ┣━ 📄 IExperimentalInterface.cs ┃ ┣━ 📄 IExperimentalStruct.cs @@ -4508,6 +4513,63 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithContainerTypes.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.ClassWithContainerTypes), fullyQualifiedName: "jsii-calc.ClassWithContainerTypes", parametersJson: "[{\\"name\\":\\"array\\",\\"type\\":{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}},{\\"name\\":\\"record\\",\\"type\\":{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}},{\\"name\\":\\"obj\\",\\"type\\":{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}},{\\"name\\":\\"props\\",\\"optional\\":true,\\"type\\":{\\"fqn\\":\\"jsii-calc.ContainerProps\\"}}]")] + public class ClassWithContainerTypes : DeputyBase + { + public ClassWithContainerTypes(Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] array, System.Collections.Generic.IDictionary record, System.Collections.Generic.IDictionary obj, Amazon.JSII.Tests.CalculatorNamespace.IContainerProps? props = null): base(new DeputyProps(new object?[]{array, record, obj, props})) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected ClassWithContainerTypes(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected ClassWithContainerTypes(DeputyProps props): base(props) + { + } + + [JsiiProperty(name: "array", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}")] + public virtual Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] Array + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "obj", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + public virtual System.Collections.Generic.IDictionary Obj + { + get => GetInstanceProperty>()!; + } + + [JsiiProperty(name: "record", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + public virtual System.Collections.Generic.IDictionary Record + { + get => GetInstanceProperty>()!; + } + + [JsiiOptional] + [JsiiProperty(name: "props", typeJson: "{\\"fqn\\":\\"jsii-calc.ContainerProps\\"}", isOptional: true)] + public virtual Amazon.JSII.Tests.CalculatorNamespace.IContainerProps? Props + { + get => GetInstanceProperty(); + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithDocs.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -5176,6 +5238,43 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ContainerProps.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + #pragma warning disable CS8618 + + [JsiiByValue(fqn: "jsii-calc.ContainerProps")] + public class ContainerProps : Amazon.JSII.Tests.CalculatorNamespace.IContainerProps + { + [JsiiProperty(name: "arrayProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}", isOverride: true)] + public Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] ArrayProp + { + get; + set; + } + + [JsiiProperty(name: "objProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}", isOverride: true)] + public System.Collections.Generic.IDictionary ObjProp + { + get; + set; + } + + [JsiiProperty(name: "recordProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}", isOverride: true)] + public System.Collections.Generic.IDictionary RecordProp + { + get; + set; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DataRenderer.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -6162,6 +6261,29 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DummyObj.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + #pragma warning disable CS8618 + + [JsiiByValue(fqn: "jsii-calc.DummyObj")] + public class DummyObj : Amazon.JSII.Tests.CalculatorNamespace.IDummyObj + { + [JsiiProperty(name: "example", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + public string Example + { + get; + set; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DynamicPropertyBearer.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -7266,6 +7388,64 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IContainerProps.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(nativeType: typeof(IContainerProps), fullyQualifiedName: "jsii-calc.ContainerProps")] + public interface IContainerProps + { + [JsiiProperty(name: "arrayProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}")] + Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] ArrayProp + { + get; + } + + [JsiiProperty(name: "objProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + System.Collections.Generic.IDictionary ObjProp + { + get; + } + + [JsiiProperty(name: "recordProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + System.Collections.Generic.IDictionary RecordProp + { + get; + } + + [JsiiTypeProxy(nativeType: typeof(IContainerProps), fullyQualifiedName: "jsii-calc.ContainerProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IContainerProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "arrayProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}")] + public Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] ArrayProp + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "objProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + public System.Collections.Generic.IDictionary ObjProp + { + get => GetInstanceProperty>()!; + } + + [JsiiProperty(name: "recordProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] + public System.Collections.Generic.IDictionary RecordProp + { + get => GetInstanceProperty>()!; + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterface.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -7778,6 +7958,40 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDummyObj.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(nativeType: typeof(IDummyObj), fullyQualifiedName: "jsii-calc.DummyObj")] + public interface IDummyObj + { + [JsiiProperty(name: "example", typeJson: "{\\"primitive\\":\\"string\\"}")] + string Example + { + get; + } + + [JsiiTypeProxy(nativeType: typeof(IDummyObj), fullyQualifiedName: "jsii-calc.DummyObj")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDummyObj + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "example", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Example + { + get => GetInstanceProperty()!; + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap index 59aa86c39b..2f3e6ec3c0 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap @@ -4963,6 +4963,83 @@ func ClassWithCollections_SetStaticMap(val *map[string]*string) { ) } +type ClassWithContainerTypes interface { + Array() *[]*DummyObj + Obj() *map[string]*DummyObj + Props() *ContainerProps + Record() *map[string]*DummyObj +} + +// The jsii proxy struct for ClassWithContainerTypes +type jsiiProxy_ClassWithContainerTypes struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithContainerTypes) Array() *[]*DummyObj { + var returns *[]*DummyObj + _jsii_.Get( + j, + "array", + &returns, + ) + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Obj() *map[string]*DummyObj { + var returns *map[string]*DummyObj + _jsii_.Get( + j, + "obj", + &returns, + ) + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Props() *ContainerProps { + var returns *ContainerProps + _jsii_.Get( + j, + "props", + &returns, + ) + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Record() *map[string]*DummyObj { + var returns *map[string]*DummyObj + _jsii_.Get( + j, + "record", + &returns, + ) + return returns +} + + +func NewClassWithContainerTypes(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) ClassWithContainerTypes { + _init_.Initialize() + + j := jsiiProxy_ClassWithContainerTypes{} + + _jsii_.Create( + "jsii-calc.ClassWithContainerTypes", + []interface{}{array, record, obj, props}, + &j, + ) + + return &j +} + +func NewClassWithContainerTypes_Override(c ClassWithContainerTypes, array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithContainerTypes", + []interface{}{array, record, obj, props}, + c, + ) +} + // This class has docs. // // The docs are great. They're a bunch of tags. @@ -5688,6 +5765,12 @@ func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(o return returns } +type ContainerProps struct { + ArrayProp *[]*DummyObj \`json:"arrayProp"\` + ObjProp *map[string]*DummyObj \`json:"objProp"\` + RecordProp *map[string]*DummyObj \`json:"recordProp"\` +} + // Verifies proper type handling through dynamic overrides. type DataRenderer interface { Render(data *scopejsiicalclib.MyFirstStruct) *string @@ -6413,6 +6496,10 @@ func (d *jsiiProxy_DoubleTrouble) Next() *float64 { return returns } +type DummyObj struct { + Example *string \`json:"example"\` +} + // Ensures we can override a dynamic property that was inherited. type DynamicPropertyBearer interface { DynamicProperty() *string @@ -14528,6 +14615,19 @@ func init() { return &jsiiProxy_ClassWithCollections{} }, ) + _jsii_.RegisterClass( + "jsii-calc.ClassWithContainerTypes", + reflect.TypeOf((*ClassWithContainerTypes)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "array", GoGetter: "Array"}, + _jsii_.MemberProperty{JsiiProperty: "obj", GoGetter: "Obj"}, + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + _jsii_.MemberProperty{JsiiProperty: "record", GoGetter: "Record"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithContainerTypes{} + }, + ) _jsii_.RegisterClass( "jsii-calc.ClassWithDocs", reflect.TypeOf((*ClassWithDocs)(nil)).Elem(), @@ -14634,6 +14734,10 @@ func init() { return &jsiiProxy_ConsumersOfThisCrazyTypeSystem{} }, ) + _jsii_.RegisterStruct( + "jsii-calc.ContainerProps", + reflect.TypeOf((*ContainerProps)(nil)).Elem(), + ) _jsii_.RegisterClass( "jsii-calc.DataRenderer", reflect.TypeOf((*DataRenderer)(nil)).Elem(), @@ -14788,6 +14892,10 @@ func init() { return &j }, ) + _jsii_.RegisterStruct( + "jsii-calc.DummyObj", + reflect.TypeOf((*DummyObj)(nil)).Elem(), + ) _jsii_.RegisterClass( "jsii-calc.DynamicPropertyBearer", reflect.TypeOf((*DynamicPropertyBearer)(nil)).Elem(), diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap index dd7bcde99e..4dc8f76a55 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap @@ -3590,6 +3590,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ClassThatImplementsTheInternalInterface.java ┃ ┣━ 📄 ClassThatImplementsThePrivateInterface.java ┃ ┣━ 📄 ClassWithCollections.java + ┃ ┣━ 📄 ClassWithContainerTypes.java ┃ ┣━ 📄 ClassWithDocs.java ┃ ┣━ 📄 ClassWithJavaReservedWords.java ┃ ┣━ 📄 ClassWithMutableObjectLiteralProperty.java @@ -3603,6 +3604,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ConsumePureInterface.java ┃ ┣━ 📄 ConsumerCanRingBell.java ┃ ┣━ 📄 ConsumersOfThisCrazyTypeSystem.java + ┃ ┣━ 📄 ContainerProps.java ┃ ┣━ 📄 DataRenderer.java ┃ ┣━ 📄 Default.java ┃ ┣━ 📄 DefaultedConstructorArgument.java @@ -3625,6 +3627,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 DoNotRecognizeAnyAsOptional.java ┃ ┣━ 📄 DontComplainAboutVariadicAfterOptional.java ┃ ┣━ 📄 DoubleTrouble.java + ┃ ┣━ 📄 DummyObj.java ┃ ┣━ 📄 DynamicPropertyBearer.java ┃ ┣━ 📄 DynamicPropertyBearerChild.java ┃ ┣━ 📄 Entropy.java @@ -6455,6 +6458,157 @@ public class ClassWithCollections extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithContainerTypes.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.ClassWithContainerTypes") +public class ClassWithContainerTypes extends software.amazon.jsii.JsiiObject { + + protected ClassWithContainerTypes(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected ClassWithContainerTypes(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + * @param array This parameter is required. + * @param record This parameter is required. + * @param obj This parameter is required. + * @param props + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public ClassWithContainerTypes(final @org.jetbrains.annotations.NotNull java.util.List array, final @org.jetbrains.annotations.NotNull java.util.Map record, final @org.jetbrains.annotations.NotNull java.util.Map obj, final @org.jetbrains.annotations.Nullable software.amazon.jsii.tests.calculator.ContainerProps props) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(array, "array is required"), java.util.Objects.requireNonNull(record, "record is required"), java.util.Objects.requireNonNull(obj, "obj is required"), props }); + } + + /** + * @param array This parameter is required. + * @param record This parameter is required. + * @param obj This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public ClassWithContainerTypes(final @org.jetbrains.annotations.NotNull java.util.List array, final @org.jetbrains.annotations.NotNull java.util.Map record, final @org.jetbrains.annotations.NotNull java.util.Map obj) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(array, "array is required"), java.util.Objects.requireNonNull(record, "record is required"), java.util.Objects.requireNonNull(obj, "obj is required") }); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.util.List getArray() { + return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "array", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class)))); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.util.Map getObj() { + return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.get(this, "obj", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class)))); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.util.Map getRecord() { + return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.get(this, "record", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class)))); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.Nullable software.amazon.jsii.tests.calculator.ContainerProps getProps() { + return software.amazon.jsii.Kernel.get(this, "props", software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.ContainerProps.class)); + } + + /** + * A fluent builder for {@link software.amazon.jsii.tests.calculator.ClassWithContainerTypes}. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static final class Builder implements software.amazon.jsii.Builder { + /** + * @return a new instance of {@link Builder}. + * @param array This parameter is required. + * @param record This parameter is required. + * @param obj This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static Builder create(final java.util.List array, final java.util.Map record, final java.util.Map obj) { + return new Builder(array, record, obj); + } + + private final java.util.List array; + private final java.util.Map record; + private final java.util.Map obj; + private software.amazon.jsii.tests.calculator.ContainerProps.Builder props; + + private Builder(final java.util.List array, final java.util.Map record, final java.util.Map obj) { + this.array = array; + this.record = record; + this.obj = obj; + } + + /** + * @return {@code this} + * @param arrayProp This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder arrayProp(final java.util.List arrayProp) { + this.props().arrayProp(arrayProp); + return this; + } + + /** + * @return {@code this} + * @param objProp This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder objProp(final java.util.Map objProp) { + this.props().objProp(objProp); + return this; + } + + /** + * @return {@code this} + * @param recordProp This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder recordProp(final java.util.Map recordProp) { + this.props().recordProp(recordProp); + return this; + } + + /** + * @returns a newly built instance of {@link software.amazon.jsii.tests.calculator.ClassWithContainerTypes}. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public software.amazon.jsii.tests.calculator.ClassWithContainerTypes build() { + return new software.amazon.jsii.tests.calculator.ClassWithContainerTypes( + this.array, + this.record, + this.obj, + this.props != null ? this.props.build() : null + ); + } + + private software.amazon.jsii.tests.calculator.ContainerProps.Builder props() { + if (this.props == null) { + this.props = new software.amazon.jsii.tests.calculator.ContainerProps.Builder(); + } + return this.props; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithDocs.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -7153,6 +7307,187 @@ public class ConsumersOfThisCrazyTypeSystem extends software.amazon.jsii.JsiiObj `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/ContainerProps.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.ContainerProps") +@software.amazon.jsii.Jsii.Proxy(ContainerProps.Jsii$Proxy.class) +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +public interface ContainerProps extends software.amazon.jsii.JsiiSerializable { + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.util.List getArrayProp(); + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.util.Map getObjProp(); + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.util.Map getRecordProp(); + + /** + * @return a {@link Builder} of {@link ContainerProps} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + static Builder builder() { + return new Builder(); + } + /** + * A builder for {@link ContainerProps} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static final class Builder implements software.amazon.jsii.Builder { + private java.util.List arrayProp; + private java.util.Map objProp; + private java.util.Map recordProp; + + /** + * Sets the value of {@link ContainerProps#getArrayProp} + * @param arrayProp the value to be set. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @SuppressWarnings("unchecked") + public Builder arrayProp(java.util.List arrayProp) { + this.arrayProp = (java.util.List)arrayProp; + return this; + } + + /** + * Sets the value of {@link ContainerProps#getObjProp} + * @param objProp the value to be set. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @SuppressWarnings("unchecked") + public Builder objProp(java.util.Map objProp) { + this.objProp = (java.util.Map)objProp; + return this; + } + + /** + * Sets the value of {@link ContainerProps#getRecordProp} + * @param recordProp the value to be set. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @SuppressWarnings("unchecked") + public Builder recordProp(java.util.Map recordProp) { + this.recordProp = (java.util.Map)recordProp; + return this; + } + + /** + * Builds the configured instance. + * @return a new instance of {@link ContainerProps} + * @throws NullPointerException if any required attribute was not provided + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public ContainerProps build() { + return new Jsii$Proxy(arrayProp, objProp, recordProp); + } + } + + /** + * An implementation for {@link ContainerProps} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @software.amazon.jsii.Internal + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ContainerProps { + private final java.util.List arrayProp; + private final java.util.Map objProp; + private final java.util.Map recordProp; + + /** + * Constructor that initializes the object based on values retrieved from the JsiiObject. + * @param objRef Reference to the JSII managed object. + */ + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + this.arrayProp = software.amazon.jsii.Kernel.get(this, "arrayProp", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class))); + this.objProp = software.amazon.jsii.Kernel.get(this, "objProp", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class))); + this.recordProp = software.amazon.jsii.Kernel.get(this, "recordProp", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.DummyObj.class))); + } + + /** + * Constructor that initializes the object based on literal property values passed by the {@link Builder}. + */ + @SuppressWarnings("unchecked") + protected Jsii$Proxy(final java.util.List arrayProp, final java.util.Map objProp, final java.util.Map recordProp) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + this.arrayProp = (java.util.List)java.util.Objects.requireNonNull(arrayProp, "arrayProp is required"); + this.objProp = (java.util.Map)java.util.Objects.requireNonNull(objProp, "objProp is required"); + this.recordProp = (java.util.Map)java.util.Objects.requireNonNull(recordProp, "recordProp is required"); + } + + @Override + public final java.util.List getArrayProp() { + return this.arrayProp; + } + + @Override + public final java.util.Map getObjProp() { + return this.objProp; + } + + @Override + public final java.util.Map getRecordProp() { + return this.recordProp; + } + + @Override + @software.amazon.jsii.Internal + public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { + final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; + final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + + data.set("arrayProp", om.valueToTree(this.getArrayProp())); + data.set("objProp", om.valueToTree(this.getObjProp())); + data.set("recordProp", om.valueToTree(this.getRecordProp())); + + final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + struct.set("fqn", om.valueToTree("jsii-calc.ContainerProps")); + struct.set("data", data); + + final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + obj.set("$jsii.struct", struct); + + return obj; + } + + @Override + public final boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ContainerProps.Jsii$Proxy that = (ContainerProps.Jsii$Proxy) o; + + if (!arrayProp.equals(that.arrayProp)) return false; + if (!objProp.equals(that.objProp)) return false; + return this.recordProp.equals(that.recordProp); + } + + @Override + public final int hashCode() { + int result = this.arrayProp.hashCode(); + result = 31 * result + (this.objProp.hashCode()); + result = 31 * result + (this.recordProp.hashCode()); + return result; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/DataRenderer.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -9107,6 +9442,127 @@ public class DoubleTrouble extends software.amazon.jsii.JsiiObject implements so `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/DummyObj.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.DummyObj") +@software.amazon.jsii.Jsii.Proxy(DummyObj.Jsii$Proxy.class) +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +public interface DummyObj extends software.amazon.jsii.JsiiSerializable { + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.lang.String getExample(); + + /** + * @return a {@link Builder} of {@link DummyObj} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + static Builder builder() { + return new Builder(); + } + /** + * A builder for {@link DummyObj} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static final class Builder implements software.amazon.jsii.Builder { + private java.lang.String example; + + /** + * Sets the value of {@link DummyObj#getExample} + * @param example the value to be set. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder example(java.lang.String example) { + this.example = example; + return this; + } + + /** + * Builds the configured instance. + * @return a new instance of {@link DummyObj} + * @throws NullPointerException if any required attribute was not provided + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public DummyObj build() { + return new Jsii$Proxy(example); + } + } + + /** + * An implementation for {@link DummyObj} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @software.amazon.jsii.Internal + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DummyObj { + private final java.lang.String example; + + /** + * Constructor that initializes the object based on values retrieved from the JsiiObject. + * @param objRef Reference to the JSII managed object. + */ + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + this.example = software.amazon.jsii.Kernel.get(this, "example", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); + } + + /** + * Constructor that initializes the object based on literal property values passed by the {@link Builder}. + */ + protected Jsii$Proxy(final java.lang.String example) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + this.example = java.util.Objects.requireNonNull(example, "example is required"); + } + + @Override + public final java.lang.String getExample() { + return this.example; + } + + @Override + @software.amazon.jsii.Internal + public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { + final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; + final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + + data.set("example", om.valueToTree(this.getExample())); + + final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + struct.set("fqn", om.valueToTree("jsii-calc.DummyObj")); + struct.set("data", data); + + final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + obj.set("$jsii.struct", struct); + + return obj; + } + + @Override + public final boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + DummyObj.Jsii$Proxy that = (DummyObj.Jsii$Proxy) o; + + return this.example.equals(that.example); + } + + @Override + public final int hashCode() { + int result = this.example.hashCode(); + return result; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/DynamicPropertyBearer.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -25103,6 +25559,7 @@ jsii-calc.ChildStruct982=software.amazon.jsii.tests.calculator.ChildStruct982 jsii-calc.ClassThatImplementsTheInternalInterface=software.amazon.jsii.tests.calculator.ClassThatImplementsTheInternalInterface jsii-calc.ClassThatImplementsThePrivateInterface=software.amazon.jsii.tests.calculator.ClassThatImplementsThePrivateInterface jsii-calc.ClassWithCollections=software.amazon.jsii.tests.calculator.ClassWithCollections +jsii-calc.ClassWithContainerTypes=software.amazon.jsii.tests.calculator.ClassWithContainerTypes jsii-calc.ClassWithDocs=software.amazon.jsii.tests.calculator.ClassWithDocs jsii-calc.ClassWithJavaReservedWords=software.amazon.jsii.tests.calculator.ClassWithJavaReservedWords jsii-calc.ClassWithMutableObjectLiteralProperty=software.amazon.jsii.tests.calculator.ClassWithMutableObjectLiteralProperty @@ -25114,6 +25571,7 @@ jsii-calc.Constructors=software.amazon.jsii.tests.calculator.Constructors jsii-calc.ConsumePureInterface=software.amazon.jsii.tests.calculator.ConsumePureInterface jsii-calc.ConsumerCanRingBell=software.amazon.jsii.tests.calculator.ConsumerCanRingBell jsii-calc.ConsumersOfThisCrazyTypeSystem=software.amazon.jsii.tests.calculator.ConsumersOfThisCrazyTypeSystem +jsii-calc.ContainerProps=software.amazon.jsii.tests.calculator.ContainerProps jsii-calc.DataRenderer=software.amazon.jsii.tests.calculator.DataRenderer jsii-calc.Default=software.amazon.jsii.tests.calculator.Default jsii-calc.DefaultedConstructorArgument=software.amazon.jsii.tests.calculator.DefaultedConstructorArgument @@ -25135,6 +25593,7 @@ jsii-calc.DoNotRecognizeAnyAsOptional=software.amazon.jsii.tests.calculator.DoNo jsii-calc.DocumentedClass=software.amazon.jsii.tests.calculator.DocumentedClass jsii-calc.DontComplainAboutVariadicAfterOptional=software.amazon.jsii.tests.calculator.DontComplainAboutVariadicAfterOptional jsii-calc.DoubleTrouble=software.amazon.jsii.tests.calculator.DoubleTrouble +jsii-calc.DummyObj=software.amazon.jsii.tests.calculator.DummyObj jsii-calc.DynamicPropertyBearer=software.amazon.jsii.tests.calculator.DynamicPropertyBearer jsii-calc.DynamicPropertyBearerChild=software.amazon.jsii.tests.calculator.DynamicPropertyBearerChild jsii-calc.Entropy=software.amazon.jsii.tests.calculator.Entropy diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 6656c640d9..b532e05cbe 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -3351,6 +3351,55 @@ class ClassWithCollections( jsii.set(self, "map", value) +class ClassWithContainerTypes( + metaclass=jsii.JSIIMeta, + jsii_type="jsii-calc.ClassWithContainerTypes", +): + def __init__( + self, + array: typing.Sequence["DummyObj"], + record: typing.Mapping[builtins.str, "DummyObj"], + obj: typing.Mapping[builtins.str, "DummyObj"], + *, + array_prop: typing.Sequence["DummyObj"], + obj_prop: typing.Mapping[builtins.str, "DummyObj"], + record_prop: typing.Mapping[builtins.str, "DummyObj"], + ) -> None: + ''' + :param array: - + :param record: - + :param obj: - + :param array_prop: + :param obj_prop: + :param record_prop: + ''' + props = ContainerProps( + array_prop=array_prop, obj_prop=obj_prop, record_prop=record_prop + ) + + jsii.create(ClassWithContainerTypes, self, [array, record, obj, props]) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="array") + def array(self) -> typing.List["DummyObj"]: + return typing.cast(typing.List["DummyObj"], jsii.get(self, "array")) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="obj") + def obj(self) -> typing.Mapping[builtins.str, "DummyObj"]: + return typing.cast(typing.Mapping[builtins.str, "DummyObj"], jsii.get(self, "obj")) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="record") + def record(self) -> typing.Mapping[builtins.str, "DummyObj"]: + return typing.cast(typing.Mapping[builtins.str, "DummyObj"], jsii.get(self, "record")) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="props") + def props(self) -> typing.Optional["ContainerProps"]: + return typing.cast(typing.Optional["ContainerProps"], jsii.get(self, "props")) + + class ClassWithDocs(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.ClassWithDocs"): '''This class has docs. @@ -3679,6 +3728,64 @@ class ConsumersOfThisCrazyTypeSystem( return typing.cast(typing.Any, jsii.invoke(self, "consumeNonInternalInterface", [obj])) +@jsii.data_type( + jsii_type="jsii-calc.ContainerProps", + jsii_struct_bases=[], + name_mapping={ + "array_prop": "arrayProp", + "obj_prop": "objProp", + "record_prop": "recordProp", + }, +) +class ContainerProps: + def __init__( + self, + *, + array_prop: typing.Sequence["DummyObj"], + obj_prop: typing.Mapping[builtins.str, "DummyObj"], + record_prop: typing.Mapping[builtins.str, "DummyObj"], + ) -> None: + ''' + :param array_prop: + :param obj_prop: + :param record_prop: + ''' + self._values: typing.Dict[str, typing.Any] = { + "array_prop": array_prop, + "obj_prop": obj_prop, + "record_prop": record_prop, + } + + @builtins.property + def array_prop(self) -> typing.List["DummyObj"]: + result = self._values.get("array_prop") + assert result is not None, "Required property 'array_prop' is missing" + return typing.cast(typing.List["DummyObj"], result) + + @builtins.property + def obj_prop(self) -> typing.Mapping[builtins.str, "DummyObj"]: + result = self._values.get("obj_prop") + assert result is not None, "Required property 'obj_prop' is missing" + return typing.cast(typing.Mapping[builtins.str, "DummyObj"], result) + + @builtins.property + def record_prop(self) -> typing.Mapping[builtins.str, "DummyObj"]: + result = self._values.get("record_prop") + assert result is not None, "Required property 'record_prop' is missing" + return typing.cast(typing.Mapping[builtins.str, "DummyObj"], result) + + def __eq__(self, rhs: typing.Any) -> builtins.bool: + return isinstance(rhs, self.__class__) and rhs._values == self._values + + def __ne__(self, rhs: typing.Any) -> builtins.bool: + return not (rhs == self) + + def __repr__(self) -> str: + return "ContainerProps(%s)" % ", ".join( + k + "=" + repr(v) for k, v in self._values.items() + ) + + class DataRenderer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DataRenderer"): '''Verifies proper type handling through dynamic overrides.''' @@ -4468,6 +4575,38 @@ class DontComplainAboutVariadicAfterOptional( return typing.cast(builtins.str, jsii.invoke(self, "optionalAndVariadic", [optional, *things])) +@jsii.data_type( + jsii_type="jsii-calc.DummyObj", + jsii_struct_bases=[], + name_mapping={"example": "example"}, +) +class DummyObj: + def __init__(self, *, example: builtins.str) -> None: + ''' + :param example: + ''' + self._values: typing.Dict[str, typing.Any] = { + "example": example, + } + + @builtins.property + def example(self) -> builtins.str: + result = self._values.get("example") + assert result is not None, "Required property 'example' is missing" + return typing.cast(builtins.str, result) + + def __eq__(self, rhs: typing.Any) -> builtins.bool: + return isinstance(rhs, self.__class__) and rhs._values == self._values + + def __ne__(self, rhs: typing.Any) -> builtins.bool: + return not (rhs == self) + + def __repr__(self) -> str: + return "DummyObj(%s)" % ", ".join( + k + "=" + repr(v) for k, v in self._values.items() + ) + + class DynamicPropertyBearer( metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DynamicPropertyBearer", @@ -9865,6 +10004,7 @@ __all__ = [ "ClassThatImplementsTheInternalInterface", "ClassThatImplementsThePrivateInterface", "ClassWithCollections", + "ClassWithContainerTypes", "ClassWithDocs", "ClassWithJavaReservedWords", "ClassWithMutableObjectLiteralProperty", @@ -9876,6 +10016,7 @@ __all__ = [ "ConsumePureInterface", "ConsumerCanRingBell", "ConsumersOfThisCrazyTypeSystem", + "ContainerProps", "DataRenderer", "Default", "DefaultedConstructorArgument", @@ -9895,6 +10036,7 @@ __all__ = [ "DocumentedClass", "DontComplainAboutVariadicAfterOptional", "DoubleTrouble", + "DummyObj", "DynamicPropertyBearer", "DynamicPropertyBearerChild", "Entropy", diff --git a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap index 1d918cad28..b190dacfa4 100644 --- a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap @@ -821,6 +821,30 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └── type: Array │ │ └─┬ map property (stable) │ │ └── type: Map string> + │ ├─┬ class ClassWithContainerTypes (stable) + │ │ └─┬ members + │ │ ├─┬ (array,record,obj,props) initializer (stable) + │ │ │ └─┬ parameters + │ │ │ ├─┬ array + │ │ │ │ └── type: Array + │ │ │ ├─┬ record + │ │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ │ ├─┬ obj + │ │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ │ └─┬ props + │ │ │ └── type: Optional + │ │ ├─┬ array property (stable) + │ │ │ ├── immutable + │ │ │ └── type: Array + │ │ ├─┬ obj property (stable) + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ ├─┬ record property (stable) + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ └─┬ props property (stable) + │ │ ├── immutable + │ │ └── type: Optional │ ├─┬ class ClassWithDocs (stable) │ │ └─┬ members │ │ └── () initializer (stable) @@ -2339,6 +2363,20 @@ exports[`jsii-tree --all 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: Optional<@scope/jsii-calc-lib.IFriendly | Array<@scope/jsii-calc-lib.IFriendly | jsii-calc.AbstractClass>> + │ ├─┬ interface ContainerProps (stable) + │ │ └─┬ members + │ │ ├─┬ arrayProp property (stable) + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: Array + │ │ ├─┬ objProp property (stable) + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ └─┬ recordProp property (stable) + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: Map jsii-calc.DummyObj> │ ├─┬ interface DeprecatedStruct (deprecated) │ │ └─┬ members │ │ └─┬ readonlyProperty property (deprecated) @@ -2413,6 +2451,12 @@ exports[`jsii-tree --all 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: string + │ ├─┬ interface DummyObj (stable) + │ │ └─┬ members + │ │ └─┬ example property (stable) + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: string │ ├─┬ interface EraseUndefinedHashValuesOptions (stable) │ │ └─┬ members │ │ ├─┬ option1 property (stable) @@ -3352,6 +3396,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├─┬ class ClassThatImplementsThePrivateInterface │ │ └── interfaces: INonInternalInterface │ ├── class ClassWithCollections + │ ├── class ClassWithContainerTypes │ ├── class ClassWithDocs │ ├── class ClassWithJavaReservedWords │ ├── class ClassWithMutableObjectLiteralProperty @@ -3485,6 +3530,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ └─┬ interfaces │ │ └── ParentStruct982 │ ├── interface ConfusingToJacksonStruct + │ ├── interface ContainerProps │ ├── interface DeprecatedStruct │ ├─┬ interface DerivedStruct │ │ └─┬ interfaces @@ -3504,6 +3550,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ └─┬ interfaces │ │ ├── DiamondInheritanceFirstMidLevelStruct │ │ └── DiamondInheritanceSecondMidLevelStruct + │ ├── interface DummyObj │ ├── interface EraseUndefinedHashValuesOptions │ ├── interface ExperimentalStruct │ ├── interface ExtendsInternalInterface @@ -4059,6 +4106,13 @@ exports[`jsii-tree --members 1`] = ` │ │ ├── static staticMap property │ │ ├── array property │ │ └── map property + │ ├─┬ class ClassWithContainerTypes + │ │ └─┬ members + │ │ ├── (array,record,obj,props) initializer + │ │ ├── array property + │ │ ├── obj property + │ │ ├── record property + │ │ └── props property │ ├─┬ class ClassWithDocs │ │ └─┬ members │ │ └── () initializer @@ -4713,6 +4767,11 @@ exports[`jsii-tree --members 1`] = ` │ ├─┬ interface ConfusingToJacksonStruct │ │ └─┬ members │ │ └── unionProperty property + │ ├─┬ interface ContainerProps + │ │ └─┬ members + │ │ ├── arrayProp property + │ │ ├── objProp property + │ │ └── recordProp property │ ├─┬ interface DeprecatedStruct │ │ └─┬ members │ │ └── readonlyProperty property @@ -4739,6 +4798,9 @@ exports[`jsii-tree --members 1`] = ` │ ├─┬ interface DiamondInheritanceTopLevelStruct │ │ └─┬ members │ │ └── topLevelProperty property + │ ├─┬ interface DummyObj + │ │ └─┬ members + │ │ └── example property │ ├─┬ interface EraseUndefinedHashValuesOptions │ │ └─┬ members │ │ ├── option1 property @@ -5285,6 +5347,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── class ClassThatImplementsTheInternalInterface │ ├── class ClassThatImplementsThePrivateInterface │ ├── class ClassWithCollections + │ ├── class ClassWithContainerTypes │ ├── class ClassWithDocs │ ├── class ClassWithJavaReservedWords │ ├── class ClassWithMutableObjectLiteralProperty @@ -5396,6 +5459,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── interface CalculatorProps │ ├── interface ChildStruct982 │ ├── interface ConfusingToJacksonStruct + │ ├── interface ContainerProps │ ├── interface DeprecatedStruct │ ├── interface DerivedStruct │ ├── interface DiamondBottom @@ -5403,6 +5467,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── interface DiamondInheritanceFirstMidLevelStruct │ ├── interface DiamondInheritanceSecondMidLevelStruct │ ├── interface DiamondInheritanceTopLevelStruct + │ ├── interface DummyObj │ ├── interface EraseUndefinedHashValuesOptions │ ├── interface ExperimentalStruct │ ├── interface ExtendsInternalInterface diff --git a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap index c52d54d191..7796087001 100644 --- a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap @@ -962,6 +962,30 @@ exports[`showAll 1`] = ` │ │ │ └── type: Array │ │ └─┬ map property │ │ └── type: Map string> + │ ├─┬ class ClassWithContainerTypes + │ │ └─┬ members + │ │ ├─┬ (array,record,obj,props) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ array + │ │ │ │ └── type: Array + │ │ │ ├─┬ record + │ │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ │ ├─┬ obj + │ │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ │ └─┬ props + │ │ │ └── type: Optional + │ │ ├─┬ array property + │ │ │ ├── immutable + │ │ │ └── type: Array + │ │ ├─┬ obj property + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ ├─┬ record property + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ └─┬ props property + │ │ ├── immutable + │ │ └── type: Optional │ ├─┬ class ClassWithDocs │ │ └─┬ members │ │ └── () initializer @@ -2480,6 +2504,20 @@ exports[`showAll 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: Optional<@scope/jsii-calc-lib.IFriendly | Array<@scope/jsii-calc-lib.IFriendly | jsii-calc.AbstractClass>> + │ ├─┬ interface ContainerProps + │ │ └─┬ members + │ │ ├─┬ arrayProp property + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: Array + │ │ ├─┬ objProp property + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: Map jsii-calc.DummyObj> + │ │ └─┬ recordProp property + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: Map jsii-calc.DummyObj> │ ├─┬ interface DeprecatedStruct │ │ └─┬ members │ │ └─┬ readonlyProperty property @@ -2554,6 +2592,12 @@ exports[`showAll 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: string + │ ├─┬ interface DummyObj + │ │ └─┬ members + │ │ └─┬ example property + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: string │ ├─┬ interface EraseUndefinedHashValuesOptions │ │ └─┬ members │ │ ├─┬ option1 property @@ -3498,6 +3542,7 @@ exports[`types 1`] = ` │ ├── class ClassThatImplementsTheInternalInterface │ ├── class ClassThatImplementsThePrivateInterface │ ├── class ClassWithCollections + │ ├── class ClassWithContainerTypes │ ├── class ClassWithDocs │ ├── class ClassWithJavaReservedWords │ ├── class ClassWithMutableObjectLiteralProperty @@ -3609,6 +3654,7 @@ exports[`types 1`] = ` │ ├── interface CalculatorProps │ ├── interface ChildStruct982 │ ├── interface ConfusingToJacksonStruct + │ ├── interface ContainerProps │ ├── interface DeprecatedStruct │ ├── interface DerivedStruct │ ├── interface DiamondBottom @@ -3616,6 +3662,7 @@ exports[`types 1`] = ` │ ├── interface DiamondInheritanceFirstMidLevelStruct │ ├── interface DiamondInheritanceSecondMidLevelStruct │ ├── interface DiamondInheritanceTopLevelStruct + │ ├── interface DummyObj │ ├── interface EraseUndefinedHashValuesOptions │ ├── interface ExperimentalStruct │ ├── interface ExtendsInternalInterface diff --git a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap index ec0f40f535..8f3bb3cfd6 100644 --- a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap @@ -41,6 +41,7 @@ Array [ "jsii-calc.ClassThatImplementsTheInternalInterface", "jsii-calc.ClassThatImplementsThePrivateInterface", "jsii-calc.ClassWithCollections", + "jsii-calc.ClassWithContainerTypes", "jsii-calc.ClassWithDocs", "jsii-calc.ClassWithJavaReservedWords", "jsii-calc.ClassWithMutableObjectLiteralProperty",