Repository navigation
fix(samples): make code samples parse on six page pairs - #2628
Merged
Merged
Conversation
- Close the outer brace of the two JSON responses in the session timeout guide. - Drop the trailing comma in the lockout response of the unlock guide. - Tag the NDJSON request body in the Data Stream payload page as jsonl. - Show the fetch and firewall handler signatures inside the default export, so each block is valid JavaScript. The en and pt-br versions get the same change.
Replace the elided handler bodies with statements the page documents and drop the '...' line from the lockout response, so every block on the four pages parses as JavaScript or JSON.
9 of 14 tasks
* origin/main: (66 commits) docs(templates): point the remaining Deploy links to the March 2026 catalog (#2599) fix(architectures): point Deploy buttons at the gallery template slugs (#2614) fix(opennext): migrate the OpenNext guide to the v4 azion.config.js format (#2651) chore(main): release docs 2.5.0 (#2638) docs(style-guide): settle closing names, sentence caps, and the date rule (#2630) chore(lint): accept the use-case closing in lint-links (#2632) feat(guides): add end-to-end tutorials for six products (#2652) fix(agreements): fix the FAQ index links and move the 2016 SLA off the current page (#2633) fix(functions): state that the Response Phase runs only Lua functions (#2650) docs(architectures): keep security-modernization and bot-management as API v3 versions (#2589) fix(runtime): clean up unused imports and JSDoc in the Node.js API samples (#2649) docs(platform): retire the v3 build and deploy journey pages (#2587) fix(compliance): correct the SOC report cadence and PCI DSS version (#2585) docs(runtime): fix the azion dev port and the function size limit (#2583) docs(console): apply the review of the Console path convention (#2644) docs(workloads): review the Workloads section with the style guide and correct it from live tests (#2570) fix(ai-inference): review the AI Inference section and correct it from live tests (#2641) docs(templates): apply the review of the migrated template guides (#2645) docs(templates): point Deploy links to the current Marketplace catalog (MM-16236) (#2582) docs(orchestrator): split how-tos into API v4 and API v3 pages (#2584) ...
…ce error bodies The send-event error log is a text prefix and an XML body, so it takes text. The AI Inference troubleshooting block held two alternative responses on two lines; each now has its own json block, formatted over several lines, with a lead-in sentence. With these, the code-block lint reports no findings on main.
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.
What & why
Related issue: MM-16258
Pages affected:
/en/documentation/guides/application-security/access-and-compliance/configure-user-session-timeout/·/pt-br/documentacao/guias/seguranca-de-aplicacoes/acesso-e-compliance/configurar-user-session-timeout//en/documentation/guides/application-security/access-and-compliance/unlock-account-lockout-policy/·/pt-br/documentacao/guias/seguranca-de-aplicacoes/acesso-e-compliance/desbloquear-account-lockout-policy//en/documentation/platform/data-stream/templates-and-payload/·/pt-br/documentacao/plataforma/data-stream/templates-e-payload//en/documentation/devtools/runtime/api-reference/handlers/·/pt-br/documentacao/devtools/runtime/api-reference/handlers//en/documentation/guides/application-development/integrations/send-event-to-endpoint/·/pt-br/documentacao/guias/desenvolvimento-de-aplicacoes/integracoes/send-event-to-endpoint//en/documentation/platform/ai-inference/troubleshooting/·/pt-br/documentacao/plataforma/ai-inference/solucao-de-problemas/The code-block lint from #2623 parses the samples on every page. On today's
mainit reports 16 findings in 12 files. This PR clears all 16, on six page pairs, so the Code blocks check on #2623 goes green once this PR is onmain. The changes are to code blocks, plus two lead-in sentences on the AI Inference troubleshooting page that introduce the block they split into two. No frontmatter or link changes.JSON responses that did not parse
GETand afterPUT, never closed their outer}. Each gets its closing brace.lockoutobject ended with a trailing comma, which JSON does not allow. The comma is gone, and so is the...line inside the result. The sibling logs guide already shows the response this way.Blocks tagged with the wrong format
json. It is nowjsonl, which the lint checks one line at a time and the bar labelsJSON Lines(docs(style-guide): adopt the jsonl tag for JSON Lines samples #2642, already onmain). The single-line data set and the JSON array example stayjson.json. It is nowtext, as the style guide asks for output that has no language.jsonblock held two alternative response bodies, one per line. They are two answers, not a JSON Lines stream, so each now has its ownjsonblock, formatted over several lines, as the style guide asks for. Each block has a lead-in sentence that names the request that gets it: a body without themodelfield, and a body that does not parse as JSON. The error strings themselves say which is which.Signatures that were not JavaScript
async fetch(request, env, ctx). Each block now shows the method inside the default export, which matches the prose ("thefetchmethod of the default export") and the ES Modules row in the handler shapes table. Each body is a statement the page documents, so the block parses: the fetch handler returnsnew Response('Hello World!'), as in the page's Example, and the firewall handler callsctx.continue(), one of the finishing actions the page lists.Merged
main. The branch mergedmain, which in the meantime added the### Parametersand### Propertiesheadings on the handlers pages, without conflicts.How I checked it
main.prettier --checkpasses on the changed files.pnpm build:localpassed: the build and the frontmatter check.Type of change
feat)fix) — typo, broken link, wrong informationdocs) — rewrite, expansion, upkeepi18n)refactor/chore) — reviewed by UXE, no content mixed inAuthor checklist
type(scope): summary(see GOVERNANCE.md §4)title,description,meta_tags,namespace,permalink,last_reviewed— the twelve pages have every key butlast_reviewed, which no page in the repo carries yet; this PR leaves frontmatter unchangedpt-brupdated in this PR or follow-upi18nissue created: — pt-br updated in this PR, with the same change on each twinpnpm build:local(build + frontmatter check) without errors