Skip to content

docs(api): Cloudflare UA note + scopes-not-an-enum versioning fix (TRA-884)#200

Merged
mikestankavich merged 1 commit into
mainfrom
miks2u/tra-884-docs-versioning-page-corrections-static-spec-refresh-api
May 30, 2026
Merged

docs(api): Cloudflare UA note + scopes-not-an-enum versioning fix (TRA-884)#200
mikestankavich merged 1 commit into
mainfrom
miks2u/tra-884-docs-versioning-page-corrections-static-spec-refresh-api

Conversation

@mikestankavich
Copy link
Copy Markdown
Contributor

Summary

Closes the docs half of the TRA-881 epic (TRA-884). Two doc-owned fixes; the third original bullet was a no-op (see below).

1. Quickstart — Cloudflare User-Agent note

docs/api/quickstart.mdx gains a :::warning in §2: the API behind Cloudflare rejects requests with a default/empty User-Agent with a Cloudflare 403 (error 1010) before the request reaches TrakRF — so there's no normal error envelope to diagnose against. curl, requests, and the generated clients pass; Python stdlib urllib is the common exception, shown with an explicit header.

2. Versioning — scopes are not an enum

docs/api/versioning.md: scope strings are a free-form string array, not a wire enum, so they carry no x-extensible-enum marker. Removed scopes from the open-enum bullet list and from the codegen-bypass sentence, and replaced it with an accurate "scope strings are not an enum" paragraph that keeps the render-unknown-scopes-as-is guidance. The tag_type row is left as-is — TRA-882 added x-extensible-enum: true to the read variants, so it is now accurate (verified against the live preview spec).

Removed from original ticket scope

The original "refresh static spec asset docs/api/openapi.public.yaml" bullet was a no-op: no such asset exists. The /api page is rendered by redocusaurus live-fetching ${appHost}/api/openapi.yaml at build time (docusaurus.config.ts), so TRA-882's spec change flows to the rendered page on the next docs deploy with no docs PR. Ticket updated accordingly.

Out of scope (flagged separately)

Relaxing the Cloudflare WAF rule so default-UA clients aren't blocked is a security-posture decision, not a docs fix — the note is the immediate mitigation.

Verification

  • pnpm build — success (client + server compiled, static files generated)
  • pnpm dlx prettier --check on both changed files — pass
  • tag_type read/write marker state confirmed against the live preview spec (read variants carry x-extensible-enum: true, request variants bare, ErrorType/FieldErrorCode unchanged)

🤖 Generated with Claude Code

…ng (TRA-884)

Quickstart: add a warning that the API behind Cloudflare rejects requests
with a default/empty User-Agent (403 / error 1010 before the request reaches
TrakRF). curl, requests, and generated clients pass; Python stdlib urllib is
the common exception, so show setting the header explicitly.

Versioning: scopes are a free-form string array, not a wire enum, so they
carry no x-extensible-enum marker. Remove the "Scope strings" entry from the
open-enum bullet list and the codegen-bypass sentence, and replace it with an
accurate "scope strings are not an enum" paragraph that keeps the
render-unknown-scopes-as-is guidance. The tag_type row is left as-is: TRA-882
added x-extensible-enum:true to the read variants, so it is now accurate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://docs.preview.trakrf.id

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 30, 2026

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7a73cf2
Status: ✅  Deploy successful!
Preview URL: https://967036a4.docs-4n7.pages.dev
Branch Preview URL: https://preview.docs-4n7.pages.dev

View logs

@mikestankavich mikestankavich merged commit 84e44c1 into main May 30, 2026
2 checks passed
@mikestankavich mikestankavich deleted the miks2u/tra-884-docs-versioning-page-corrections-static-spec-refresh-api branch May 30, 2026 05:03
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.

1 participant