Repository navigation
docs(example): add README for example/json-builder (issue #275) - #330
Merged
gg582 merged 1 commit intoOct 9, 2026
Merged
Conversation
Add example/json-builder/README.md describing the step-1-basic program: how to build and run it, its output, and how each part builds its JSON (flat object, a nested object appended by hand to the builder buffer, and an array of objects), including the escaping, NULL and comma behaviour of the builder helpers. Part of the per-directory README work in issue c4punks#275. No source changes.
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.
Part of #275 (one directory per PR; this one covers example/json-builder).
Problem
example/json-builder has no README. Issue #275 lists it among the example directories that have none.
Fix
Add example/json-builder/README.md: how to build and run step-1-basic, its output, and how each part builds its JSON (flat object, a nested object appended by hand to the builder buffer, and an array of objects). It links to docs/api/json.md.
Verification
make -C example/json-builder/step-1-basicand ran it: exit status 0, output matches the README.\"and\n, a NULL string value is written asnull, andcwist_json_begin_arraywith a key followed bycwist_json_add_stringwith a NULL key produces"tags":["a","b"]with commas inserted by the builder.begin_objectthat takes a key, which is why the example appends the nested object as raw text; the README says so.Scope