Skip to content

docs(example): add README for example/json-builder (issue #275) - #330

Merged
gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:docs/example-json-builder-readme
Oct 9, 2026
Merged

gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:docs/example-json-builder-readme

Conversation

@Bhumika-1432006

Copy link
Copy Markdown
Contributor

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

  • Built with make -C example/json-builder/step-1-basic and ran it: exit status 0, output matches the README.
  • Checked by running a small program: a string value containing a quote and a newline is written as \" and \n, a NULL string value is written as null, and cwist_json_begin_array with a key followed by cwist_json_add_string with a NULL key produces "tags":["a","b"] with commas inserted by the builder.
  • The header has no begin_object that takes a key, which is why the example appends the nested object as raw text; the README says so.
  • ASCII check on the new file: clean.

Scope

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.
@gg582
gg582 merged commit 7d308f5 into c4punks:dev Oct 9, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants