Skip to content

Commit

Permalink
[codegen]: Remove nullable types from weakly typed arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
seclerp committed Jul 7, 2024
1 parent e8aedda commit 88624ff
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ChromeProtocol.Domains/Generated/DOM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public record RGBAType(
/// <summary>An array of quad vertices, x immediately followed by y for each point, points clock-wise.</summary>
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record QuadType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/ChromeProtocol.Domains/Generated/DOMSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int Value
/// <summary>Index of the string in the strings table.</summary>
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record ArrayOfStringsType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down Expand Up @@ -221,7 +221,7 @@ System.Collections.Generic.IReadOnlyList<int> Value
}
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record RectangleType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/ChromeProtocol.Domains/Generated/DOMStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public record StorageIdType(
/// <summary>DOM Storage item.</summary>
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record ItemType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/ChromeProtocol.Domains/Generated/LayerTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public record LayerType(
/// <summary>Array of timings, one per paint step.</summary>
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record PaintProfileType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/ChromeProtocol.Domains/Generated/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public record FilterEntryType(
/// </summary>
[Newtonsoft.Json.JsonConverter(typeof(ChromeProtocol.Core.ArrayTypeConverter))]
public record TargetFilterType(
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken?> Items
System.Collections.Generic.IReadOnlyCollection<Newtonsoft.Json.Linq.JToken> Items
) : ChromeProtocol.Core.IArrayType
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 88624ff

Please sign in to comment.