Closed SergeyMenshykh closed 3 days ago
This is due to the implementation targeting System.Text.Json v8 using reflection to resolve certain metadata such as nullability annotations and constructor parameters. It can be worked around by disabling the IlcTrimMetadata
property in the application's project configuration.
The implementation targeting System.Text.Json v9 is not impacted by this issue since it sources all its metadata from the STJ source generator.
Description
JsonSchemaMapper v8 produces an incorrect JSON Schema in a Native-AOT scenarios. However, in non-Native-AOT scenarios, it works as expected and generates the correct schema.
Type for which to generate the schema
Expected result
Actual result
Steps to reproduce
dotnet publish -r win-x64
command,.\bin\Release\net8.0\win-x64\publish\TypeSchemaGenerationInAOT.exe
and observe the results.Envornment
.net 8, JsonSchemaMapper v8 source code