From 1aafed4251bd4fd15dc9ad54441b812353a0bdd9 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Fri, 2 Aug 2024 12:43:37 +0100 Subject: [PATCH] Backport fix from https://github.com/eiriktsarpalis/stj-schema-mapper/pull/4 --- .../src/Schema/JsonSchemaMapper.ReflectionHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/src/InternalUtilities/src/Schema/JsonSchemaMapper.ReflectionHelpers.cs b/dotnet/src/InternalUtilities/src/Schema/JsonSchemaMapper.ReflectionHelpers.cs index 31c582756e66..11dc0c6d85b7 100644 --- a/dotnet/src/InternalUtilities/src/Schema/JsonSchemaMapper.ReflectionHelpers.cs +++ b/dotnet/src/InternalUtilities/src/Schema/JsonSchemaMapper.ReflectionHelpers.cs @@ -25,7 +25,7 @@ static partial class JsonSchemaMapper private static Type GetElementType(JsonTypeInfo typeInfo) { Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary); - return (Type)typeof(JsonTypeInfo).GetProperty("ElementType", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(typeInfo)!; + return (Type)typeof(JsonTypeInfo).GetProperty("ElementType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(typeInfo)!; } // The source generator currently doesn't populate attribute providers for properties