Description
Discovered while investigating modelcontextprotocol/csharp-sdk#601
Reproduction Steps
using System.Text.Json;
using System.Text.Json.Schema;
JsonSchemaExporterOptions options = new() { TreatNullObliviousAsNonNullable = true };
Console.WriteLine(JsonSerializerOptions.Default.GetJsonSchemaAsNode(typeof(int?), exporterOptions: options));
Expected behavior
Should have produced
{
"type": ["integer","null"]
}
Actual behavior
Actually produces
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response