fix(test): repair stale --json-schema integration assertion#4075
Merged
Conversation
The "fails fast at CLI parse time on invalid JSON Schema" integration
test stopped exercising the Ajv strict-compile path once the
`--json-schema` root-accepts-object precheck landed. The precheck rejects
`{type: "this-is-not-a-real-type"}` before Ajv runs, so the CLI exits
with the "root must accept object-typed values" error instead of the
"is not a valid JSON Schema" error the test expects.
Move the bogus `type` into a property so the root precheck passes and
Ajv catches the unknown type, restoring the test's original intent.
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
pushed a commit
that referenced
this pull request
May 17, 2026
The "fails fast at CLI parse time on invalid JSON Schema" integration
test stopped exercising the Ajv strict-compile path once the
`--json-schema` root-accepts-object precheck landed. The precheck rejects
`{type: "this-is-not-a-real-type"}` before Ajv runs, so the CLI exits
with the "root must accept object-typed values" error instead of the
"is not a valid JSON Schema" error the test expects.
Move the bogus `type` into a property so the root precheck passes and
Ajv catches the unknown type, restoring the test's original intent.
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.
Summary
--json-schema headless structured output › fails fast at CLI parse time on invalid JSON Schemanow feeds the CLI a schema whose root accepts objects but whose nested property carries a bogustype, so it actually exercises the Ajv strict-compile path it was written to cover.--json-schema root must accept object-typed valuesprecheck. That precheck rejects{type: "this-is-not-a-real-type"}before Ajv runs, producing a different error string than the assertion expected. The test had been silently passing under the old ordering and started failing once integration tests next ran on the scheduled Release workflow.Validation
dist/cli.jsis invoked with--json-schema '{"type":"object","properties":{"x":{"type":"this-is-not-a-real-type"}}}'./--json-schema is not a valid JSON Schema/i.Scope / Risk
Testing Matrix
Testing matrix notes:
Linked Issues / Bugs
Fixes the integration-test failure surfaced by the scheduled Release run https://github.com/QwenLM/qwen-code/actions/runs/25705113751.