Skip to content

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Jul 31, 2025

Fix #6656.

Microsoft Reviewers: Open in CodeFlow

@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 13:05
@eiriktsarpalis eiriktsarpalis requested a review from a team as a code owner July 31, 2025 13:05
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Jul 31, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@eiriktsarpalis eiriktsarpalis merged commit c9584a4 into dotnet:main Jul 31, 2025
7 checks passed
This was referenced Aug 14, 2025
This was referenced Aug 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai Microsoft.Extensions.AI libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

response_format error after updating to => 9.5.0
2 participants