-
Notifications
You must be signed in to change notification settings - Fork 827
Include a trivial items keyword if missing. #6669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds handling for trivial array types in JSON schema generation to ensure they include an "items" property. The change addresses issue #6656 by modifying the schema transformation logic to automatically add an empty "items" object when processing enumerable types that don't already have this property defined.
- Adds logic to include a trivial "items" keyword for enumerable types missing this property
- Includes a new test case to verify the behavior for
object[]
arrays - Updates the test JSON serialization context to support the new test type
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
AIJsonUtilities.Schema.Create.cs | Adds logic to include empty "items" object for enumerable types without existing items property |
AIJsonUtilitiesTests.cs | Adds test case and JSON serialization support for object[] to verify the fix |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.Create.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Fix #6656.
Microsoft Reviewers: Open in CodeFlow