We know we're going to need some STJ 8 functionality for trim/NativeAOT support. This will allow us to begin experimenting in advance.
Modifications
Upgrade the libraries
Remove the JsonNullableDateConverter, custom converters now handle Nullable<T> correctly in source-generated contexts without a custom converter
Drop our internal JsonStringEnumConverter<T> implementation in favor of the new implemenation in STJ 8 which is trim-compatible.
Add RequiresUnreferencedCode and RequiresDynamicCode annotations to the JsonTypeSerializer constructors
Add another constructor which accepts a JsonSerializerContext and doesn't produce those warnings
Use the new JsonSerializerOptions.MakeReadOnly(true) overload to ensure the passed options has a reflection resolver (if required)
Use the JsonContext.Create overload that takes JsonTypeInfo
Results
Until .NET 8 is released we can't use the main branch to create SDK releases unless they have prerelease versions. However, we can move forward with trim/NativeAOT work in preparation for .NET 8. We don't currently plan to release Yardarm 0.5.0 prior to Nov 2023 so this shouldn't be a blocker.
Motivation
We know we're going to need some STJ 8 functionality for trim/NativeAOT support. This will allow us to begin experimenting in advance.
Modifications
JsonNullableDateConverter
, custom converters now handleNullable<T>
correctly in source-generated contexts without a custom converterJsonStringEnumConverter<T>
implementation in favor of the new implemenation in STJ 8 which is trim-compatible.RequiresUnreferencedCode
andRequiresDynamicCode
annotations to theJsonTypeSerializer
constructorsJsonSerializerContext
and doesn't produce those warningsJsonSerializerOptions.MakeReadOnly(true)
overload to ensure the passed options has a reflection resolver (if required)JsonContext.Create
overload that takesJsonTypeInfo
Results
Until .NET 8 is released we can't use the
main
branch to create SDK releases unless they have prerelease versions. However, we can move forward with trim/NativeAOT work in preparation for .NET 8. We don't currently plan to release Yardarm 0.5.0 prior to Nov 2023 so this shouldn't be a blocker.