mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2469] [CLOSED] serve: reject array-root JSON instead of extracting a nested object #4055
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4055
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2469
Author: @bettercallcaleb
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:fix/structured-array-root-validation-20261014📝 Commits (1)
7883492serve: reject array roots in structured JSON object responses📊 Changes
2 files changed (+73 additions, -0 deletions)
View changed files
📝
serve/structured.py(+11 -0)📝
serve/test_structured.py(+62 -0)📄 Description
Title
Issue: Resolves #2467
Summary
With object-root structured output,
[{"answer":1},{"answer":2}]currently succeeds as{"answer":1}, silently dropping the array and remaining elements.What changed
serve/structured.py: Preserve a detected array root for existing object/schema validation instead of extracting a nested object. Keep prose and Markdown-fenced object extraction working.serve/test_structured.py: Add HTTP, streaming, schema, nested-array and bracketed-prose regression cases.Extra Notes
main. An additional 12 tests passed without optionaljsonschema./v1/responsestested in both streaming and non-streaming modes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.