Fix invalid JSON in documentation code examples - #45879
Conversation
Six fenced `json` blocks across five articles do not parse. Each is a one-character fix: one missing comma and five trailing commas. The two most visible are tagged `json copy`, so the site renders a copy button on a sample that will not parse where the reader pastes it: - `customize-containers.md` is missing the comma after `"image": "node:18"`. Line 295 of the same file has the comma, so this is a typo rather than a house style. - `hooks.md` has a trailing comma after the `sessionStart` array. The rest are trailing commas, which JSON does not allow: - `expressions.md` — the `vegetables` object and the filter-result array - `publish-nodejs-packages.md` — after the `repository` object. A `package.json` with this trailing comma is rejected by npm. - `github-event-types.md` — after the `org` object Verified by parsing every fenced `json` block in `content/` before and after: these five files go from six failing blocks to zero, and no other block changes state. Blocks that are deliberately invalid were left alone, including the "common validation errors" examples, the newline-delimited JSON in `team-level-metrics.md`, and the `/* hook entries */` placeholder in `hooks-reference.md`.
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
👋 @SurefireStudios Thanks for opening a PR! I'll get this triaged for the team to review. |
mchammer01
left a comment
There was a problem hiding this comment.
@SurefireStudios👋🏻 - Thanks for spotting and fixing these invalid JSON examples. The changes are clear, accurate, and nicely scoped. I’ve checked the updated examples and all six now parse correctly. Thanks for contributing 💖
|
Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues ⚡ |
Why:
Closes:
No existing issue — this is a technical correction found by parsing every fenced
jsonblock incontent/.Six
jsoncode blocks across five articles are not valid JSON. Each is a one-character fix: one missing comma and five trailing commas.Two of them are tagged
json copy, so the site renders a copy button on a sample that will not parse where the reader pastes it:prepare_jobexample is missing the comma after"image": "node:18". Line 295 of the same file has the comma in the equivalent spot, so this is a typo rather than a house style.sessionStartarray, in the block that introduces the hook configuration format.The other three are trailing commas, which JSON does not permit:
vegetablesobject and the filter-result array beneath it.repositoryobject. Apackage.jsoncopied as printed is rejected by npm withJSONError: Unexpected token }.orgobject in the example response.The last one is under
content/rest/, but it's a hand-written guide rather than the generated REST reference, so it isn't covered by the "we cannot accept contributions to the REST API reference documentation" rule. Happy to drop it from this PR if you'd rather keepcontent/rest/changes separate.What's being changed (if available, include any code snippets, screenshots, or gifs):
Nine lines, all commas. No prose, structure, or sample values were touched.
actions/how-tos/manage-runners/self-hosted-runners/customize-containers.md"image": "node:18"copilot/concepts/agents/hooks.mdsessionStartarrayactions/reference/workflows-and-actions/expressions.mdactions/tutorials/publish-packages/publish-nodejs-packages.mdrepositoryrest/using-the-rest-api/github-event-types.mdorgThe
customize-containers.mdone, as an example:"jobContainer": { - "image": "node:18" + "image": "node:18", "workingDirectory": "/__w/octocat-test2/octocat-test2",How this was found and checked. I extracted every fenced
```jsonblock undercontent/and ran it through a JSON parser, before and after. These five files go from six failing blocks to zero, and no other block changes state.Blocks that are meant to be invalid were deliberately left alone — the "common validation errors when creating issue forms" examples, the newline-delimited JSON in
copilot-usage-metrics/team-level-metrics.md, the/* hook entries */placeholder inhooks-reference.md, and the parse-error demonstrations inworkflow-syntax.md.Check off the following:
A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
Accuracy here is machine-checkable rather than a judgement call: each block either parses as JSON or it doesn't, and no documented value or key was changed. That said, please do sanity-check that none of the six was intentionally invalid — I believe none were, but you know the content better than a parser does.
The changes in this PR meet the docs fundamentals that are required for all content.
All CI checks are passing and the changes look good in the review environment.
Confirmed after opening: 44 checks passing, 7 skipped (the maintainer-only workflows), none failing —
content-linterincluded.