fix(i18n): fix OpenAPI path encoding, dry-run guard, and refresh registry spec (Supersedes #1249)#1309
fix(i18n): fix OpenAPI path encoding, dry-run guard, and refresh registry spec (Supersedes #1249)#1309lin-bot23 wants to merge 2 commits into
Conversation
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.
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (20)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify 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. Comment |
Summary
Fixes and improvements for the OpenAPI translation pipeline introduced in #1249. Supersedes that PR.
Fixes
Path key encoding: Changed from dot-joined paths to JSON Pointer (RFC 6901) style with
~0/~1escaping. 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.Dry-run guard:
ensureEnglishOpenApiSourcenow checksoptions.dryRunbefore fetching and writing.--dry-run --fetch-openapino longer overwrites vendored specs.translateOpenApiBatch bug: Passed the full
ApiCallResultobject tocleanModelOutputinstead ofraw.content, causingundefined is not a functionerrors with DeepSeek model output (thinking-tag stripping failed on non-string input).README contradiction: Sidecar location now correctly documented as
openapi/.i18n/{basename}.json(matchingsidecarPathForOutput()) instead of incorrectly stating*.i18n.jsonbeside specs.Registry snapshot refreshed: Updated from 312 paths to 324 paths via
--fetch-openapi. Includes new Gemini Interaction schemas and endpoints.Verification
docs.jsonis valid JSON--dry-run --fetch-openapino longer writes vendored specsTo regenerate localized specs
Run with a working
TRANSLATE_API_KEY:The DeepSeek API key in
.env.localexpired during this fix; localized spec files are removed pending regeneration with a valid key.