Convert nested-intersection-union unit test to a schema fixture test#1
Merged
Ankur Goyal (ankrgyl) merged 1 commit intoJul 12, 2026
Conversation
Replace the Vitest unit test (which checked Rust output strings for one language) with a standard JSON Schema fixture exercising the same shape: an allOf nested inside a oneOf inside another oneOf, taken from the issue #2913 repro. The fixture runs against every language in CI, round-trips a positive instance, and expects failure on a malformed union member for languages with the "union" feature. Verified end-to-end locally with schema-golang and schema-typescript; all 22 CI target languages generate successfully from the schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Converts the Vitest unit test from glideapps#2914 (
test/unit/nested-intersection-union.test.ts) into a standard JSON Schema fixture test:test/inputs/schema/nested-intersection-union.schema— a trimmed repro of FlattenUnions fails when unifying an array element union that indirectly contains an intersection. glideapps/quicktype#2913: an intersection (allOf) nested inside a union (oneOf), reached through an array, which crashedFlattenUnionswith "Internal error: Unknown type intersection" before the fix on this branch.nested-intersection-union.1.json— positive instance covering all union variants (fully-populated item plus Message-only, FunctionOutput-only, and ReasoningItem-only partials), round-tripped by the harness.nested-intersection-union.1.fail.union.json— negative example (structural mismatch: array where an item object is expected), following theclass-map-unionfixture precedent.Why
quicktype's maintainers prefer regression coverage for type-graph fixes as schema fixtures rather than renderer-output string assertions — fixtures run for all 22 CI target languages automatically, so the fix is exercised end-to-end everywhere, not just in Rust.
Verification
skipSchemaentries needed).schema-golangandschema-typescript(positive round-trip + expected failure both run); remaining compiled-language toolchains are covered by CI.Merging this into
intersection-fixwill update glideapps#2914 automatically.🤖 Generated with Claude Code