- Notifications
You must be signed in to change notification settings - Fork845
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 forobject[] to verify the fix |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.Create.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
stephentoub left a comment
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
c9584a4 intodotnet:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fix#6656.
Microsoft Reviewers:Open in CodeFlow