From 88624ff6e9f6af2ecc81042fb003e50d2282229f Mon Sep 17 00:00:00 2001 From: Andrii Rublov Date: Sun, 7 Jul 2024 23:36:26 +0200 Subject: [PATCH] [codegen]: Remove nullable types from weakly typed arrays --- src/ChromeProtocol.Domains/Generated/DOM.cs | 2 +- src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs | 4 ++-- src/ChromeProtocol.Domains/Generated/DOMStorage.cs | 2 +- src/ChromeProtocol.Domains/Generated/LayerTree.cs | 2 +- src/ChromeProtocol.Domains/Generated/Target.cs | 2 +- .../CodeGeneration/Pipeline/Steps/GenerateCsharpStep.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ChromeProtocol.Domains/Generated/DOM.cs b/src/ChromeProtocol.Domains/Generated/DOM.cs index a73759f..c108a7a 100644 --- a/src/ChromeProtocol.Domains/Generated/DOM.cs +++ b/src/ChromeProtocol.Domains/Generated/DOM.cs @@ -217,7 +217,7 @@ public record RGBAType( /// An array of quad vertices, x immediately followed by y for each point, points clock-wise. [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record QuadType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } diff --git a/src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs b/src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs index 885c2bd..8f6574c 100644 --- a/src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs +++ b/src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs @@ -192,7 +192,7 @@ int Value /// Index of the string in the strings table. [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record ArrayOfStringsType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } @@ -221,7 +221,7 @@ System.Collections.Generic.IReadOnlyList Value } [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record RectangleType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } diff --git a/src/ChromeProtocol.Domains/Generated/DOMStorage.cs b/src/ChromeProtocol.Domains/Generated/DOMStorage.cs index ecfecf3..f36fc47 100644 --- a/src/ChromeProtocol.Domains/Generated/DOMStorage.cs +++ b/src/ChromeProtocol.Domains/Generated/DOMStorage.cs @@ -29,7 +29,7 @@ public record StorageIdType( /// DOM Storage item. [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record ItemType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } diff --git a/src/ChromeProtocol.Domains/Generated/LayerTree.cs b/src/ChromeProtocol.Domains/Generated/LayerTree.cs index 0b91db8..d77f0a6 100644 --- a/src/ChromeProtocol.Domains/Generated/LayerTree.cs +++ b/src/ChromeProtocol.Domains/Generated/LayerTree.cs @@ -120,7 +120,7 @@ public record LayerType( /// Array of timings, one per paint step. [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record PaintProfileType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } diff --git a/src/ChromeProtocol.Domains/Generated/Target.cs b/src/ChromeProtocol.Domains/Generated/Target.cs index 596f6f8..2e7db6b 100644 --- a/src/ChromeProtocol.Domains/Generated/Target.cs +++ b/src/ChromeProtocol.Domains/Generated/Target.cs @@ -73,7 +73,7 @@ public record FilterEntryType( /// [Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))] public record TargetFilterType( - System.Collections.Generic.IReadOnlyCollection Items + System.Collections.Generic.IReadOnlyCollection Items ) : ChromeProtocol.Core.IArrayType { } diff --git a/src/ChromeProtocol.Tools/CodeGeneration/Pipeline/Steps/GenerateCsharpStep.cs b/src/ChromeProtocol.Tools/CodeGeneration/Pipeline/Steps/GenerateCsharpStep.cs index 9db0b74..fa6dea9 100644 --- a/src/ChromeProtocol.Tools/CodeGeneration/Pipeline/Steps/GenerateCsharpStep.cs +++ b/src/ChromeProtocol.Tools/CodeGeneration/Pipeline/Steps/GenerateCsharpStep.cs @@ -104,7 +104,7 @@ private static CsharpClassDeclBuilder GenerateType(ValidatedType type, Validated case { Kind: TypeKind.Array }: var itemsType = CsharpTypeInfo.FromGenericType("System.Collections.Generic", "IReadOnlyCollection", - CsharpTypeInfo.MakeNullable(CsharpTypeInfo.FromTypeName("Newtonsoft.Json.Linq", "JToken"))); + CsharpTypeInfo.FromTypeName("Newtonsoft.Json.Linq", "JToken")); return classBuilder.Record(CsharpNameResolver.Resolve(type.Id, ItemKind.TypeName, classBuilder.Node.Name), recordBuilder => recordBuilder.Modifiers("public") .Attribute(CsharpTypeInfo.FromTypeName("Newtonsoft.Json", nameof(JsonConverter)),