Repository navigation
Fix JSON separator and value validation - #1789
Merged
michaelrsweet merged 2 commits intoOct 26, 2026
Merged
michaelrsweet merged 2 commits into
michaelrsweet merged 2 commits into
Conversation
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
michaelrsweet
approved these changes
Oct 26, 2026
michaelrsweet
left a comment
Member
There was a problem hiding this comment.
I like the addition of the syntax checks to the unit test file.
I think there are some coding style things here I'll need to tweak but I can do that post-merge.
michaelrsweet
added a commit
that referenced
this pull request
Oct 26, 2026
- Coding style/indentation - Update testjson output for syntax checks - Update test-internal.h to escape strings in output
Member
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.
cupsJSONImportString()accepts inputs such as{"a":},{"a":[1 2]}, and{} trailing text. Require commas between members/elements, a value after a colon, and only whitespace after the root object. This prevents incomplete key/value pairs from being returned as successfully parsed objects.Fixes #1788.
The regression table contains 21 valid and invalid examples, including nested/empty containers and surrounding whitespace. Eleven malformed examples were accepted before the fix; all 21 now behave as expected.
Validation on Linux/WSL with the existing configured build:
cups/testjsonand the static CUPS library.make -C cups test: 656 passing checks across the array, clock, file, form, HTTP, IPP, internationalization, JSON, JWT, language, option, PPD, PWG, and raster tests.Credentials do not validate against CA certificates.It failed before and after this change. Certificate validation was not bypassed.git diff --checkpassed.The current test helper does not propagate
testEndMessage(false, ...)to the program's exit status, so validation above is based on the individual results, not just the command exit code. The new regression table usestestEnd, which correctly returns a failing status before the fix. The helper issue is being handled separately.