Skip to content

fix(i18n): fix OpenAPI path encoding, dry-run guard, and refresh registry spec (Supersedes #1249)#1309

Open
lin-bot23 wants to merge 2 commits into
Comfy-Org:mainfrom
lin-bot23:docs/openapi-i18n-fixes
Open

fix(i18n): fix OpenAPI path encoding, dry-run guard, and refresh registry spec (Supersedes #1249)#1309
lin-bot23 wants to merge 2 commits into
Comfy-Org:mainfrom
lin-bot23:docs/openapi-i18n-fixes

Conversation

@lin-bot23

Copy link
Copy Markdown
Contributor

Summary

Fixes and improvements for the OpenAPI translation pipeline introduced in #1249. Supersedes that PR.

Fixes

  1. Path key encoding: Changed from dot-joined paths to JSON Pointer (RFC 6901) style with ~0/~1 escaping. Dots in OpenAPI path segments (e.g. /proxy/bfl/flux-pro-1.1/generate) no longer corrupt path traversal — 12 such paths exist in the registry spec. Old dot-format paths silently caused writes to fail on paths containing dots.

  2. Dry-run guard: ensureEnglishOpenApiSource now checks options.dryRun before fetching and writing. --dry-run --fetch-openapi no longer overwrites vendored specs.

  3. translateOpenApiBatch bug: Passed the full ApiCallResult object to cleanModelOutput instead of raw.content, causing undefined is not a function errors with DeepSeek model output (thinking-tag stripping failed on non-string input).

  4. README contradiction: Sidecar location now correctly documented as openapi/.i18n/{basename}.json (matching sidecarPathForOutput()) instead of incorrectly stating *.i18n.json beside specs.

  5. Registry snapshot refreshed: Updated from 312 paths to 324 paths via --fetch-openapi. Includes new Gemini Interaction schemas and endpoints.

Verification

  • All 13 Bun tests pass
  • docs.json is valid JSON
  • --dry-run --fetch-openapi no longer writes vendored specs
  • Registry path count: 312 -> 324
  • 12 dot-containing paths confirmed extractable via JSON Pointer

To regenerate localized specs

Run with a working TRANSLATE_API_KEY:

pnpm translate -- --openapi-only --force

The DeepSeek API key in .env.local expired during this fix; localized spec files are removed pending regeneration with a valid key.

comfyui-wiki and others added 2 commits July 22, 2026 14:05
Wire cloud and registry OpenAPI specs into pnpm translate with per-language
YAML under openapi/, Mintlify docs.json paths per locale, and pretty-printed
output for readable zh/ja/ko API reference pages.
…stry spec

Supersedes Comfy-Org#1249.

Fixes for the OpenAPI translation pipeline:

- Path key encoding: use JSON Pointer (RFC 6901) style with ~0/~1
  escaping instead of dot-joined paths. Dots in OpenAPI path segments
  (e.g. /proxy/bfl/flux-pro-1.1/generate) no longer corrupt path
  traversal. extractTranslatableStrings and applyTranslations now
  produce/consume root-relative /-separated paths with proper escaping.

- Dry-run guard: ensureEnglishOpenApiSource now checks options.dryRun
  before writing vendored spec files. --dry-run --fetch-openapi no
  longer overwrites the on-disk snapshot.

- translateOpenApiBatch bug fix: pass raw.content (string) to
  cleanModelOutput instead of the raw ApiCallResult object. This
  caused 'undefined is not a function' errors on DeepSeek output.

- README fix: sidecar location description now matches actual code
  (openapi/.i18n/{basename}.json instead of *.i18n.json beside specs).

- Refresh registry snapshot from live API (312 -> 324 paths, includes
  new Gemini Interaction schemas).

- Remove stale localized specs and sidecars (generated with broken
  dot-format paths). Regenerate with:
    pnpm translate -- --openapi-only --force

All 13 bun tests pass.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@lin-bot23, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fafa0336-f944-4264-a56c-662f2a85fd1a

📥 Commits

Reviewing files that changed from the base of the PR and between 4970189 and 61a672b.

📒 Files selected for processing (20)
  • .cursor/skills/docs-i18n-translate/SKILL.md
  • .github/scripts/i18n/README.md
  • .github/scripts/i18n/check-i18n-sync.mjs
  • .github/scripts/i18n/openapi-translate.test.ts
  • .github/scripts/i18n/openapi-translate.ts
  • .github/scripts/i18n/reformat-openapi.ts
  • .github/scripts/i18n/sync-docs-json.mjs
  • .github/scripts/i18n/translate-i18n.ts
  • .github/scripts/i18n/translation-config.json
  • .github/workflows/i18n-sync-check.yml
  • development/cloud/openapi.mdx
  • docs.json
  • ja/development/cloud/openapi.mdx
  • ko/development/cloud/openapi.mdx
  • openapi/.i18n/cloud.ja.json
  • openapi/.i18n/cloud.zh.json
  • openapi/cloud.en.yaml
  • openapi/registry.en.yaml
  • package.json
  • zh/development/cloud/openapi.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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