-
Notifications
You must be signed in to change notification settings - Fork 839
Closed
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI librariesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Description
Description
Attempting to use CreateJsonSchema
with a new()
instance, throws.
Would be ideal that the new()
instance had a DefualtOptions
for the typeresolver to avoid the exception or better approach.
[Fact]
public static void CreateJsonSchema_NewSerializerOptions_ShouldNotThrow()
{
JsonElement expected = JsonDocument.Parse("""{"type":"integer"}""").RootElement;
JsonElement actual = AIJsonUtilities.CreateJsonSchema(typeof(int), serializerOptions: new());
Assert.Equal(expected, actual);
}
Reproduction Steps
AIJsonUtilities.CreateJsonSchema(typeof(int), serializerOptions: new());
Expected behavior
Not throw
Actual behavior
Throwing for a new() serializerOptions instance.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI librariesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.