Skip to content

refactor(config): rename config.swagger → config.openapi (gates the OpenAPI spec, not Swagger-UI) - #3891

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
refactor/config-swagger-to-openapi
Jun 16, 2026
Merged

PierreBrisorgueil merged 1 commit into
masterfrom
refactor/config-swagger-to-openapi

Conversation

@PierreBrisorgueil

Copy link
Copy Markdown
Contributor

Pure rename, no behavior change.

The config.swagger namespace gated the OpenAPI JSON spec served at /api/spec.json — but there is no Swagger-UI (the Redoc UI was decommissioned earlier), so the name was misleading.

Changes

  • config.swagger → config.openapi (defaults in config/defaults/development.config.js + production.config.js)
  • config.swagger.publicInProd → config.openapi.public (drops the redundant InProd suffix; semantics = "serve the spec publicly"; still secure-by-default public: false)
  • config.files.swagger glob key → config.files.openapi (lib/helpers/config.js + the fileKeys filter in config/index.js)
  • initApiSpec gate in lib/services/express.js reads the new keys; internal log prefixes [swagger] → [openapi]
  • MIGRATIONS.md entry with the downstream /update-stack action

Verification

  • Scoped unit suites green (express.docs / docsEnvGate / openapi-servers / errorroutes + core): 120/120
  • eslint clean on all changed files
  • /api/spec.json asserted served when config.openapi.public is true under a prod-grade env, gated otherwise

Copilot AI review requested due to automatic review settings June 16, 2026 14:12
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@PierreBrisorgueil, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a16b89ee-9713-4216-88ad-c6ef94c26ed7

📥 Commits

Reviewing files that changed from the base of the PR and between ddc34d0 and bff9e16.

📒 Files selected for processing (11)
  • MIGRATIONS.md
  • config/defaults/development.config.js
  • config/defaults/production.config.js
  • config/index.js
  • lib/helpers/config.js
  • lib/services/express.js
  • lib/services/tests/express.docs.unit.tests.js
  • lib/services/tests/express.docsEnvGate.unit.tests.js
  • lib/services/tests/express.errorroutes.unit.tests.js
  • lib/services/tests/express.openapi-servers.unit.tests.js
  • modules/core/tests/core.unit.tests.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/config-swagger-to-openapi

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 and usage tips.

@codecov

codecov Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (ddc34d0) to head (bff9e16).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3891   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         169      169           
  Lines        5535     5535           
  Branches     1778     1778           
=======================================
  Hits         5129     5129           
  Misses        326      326           
  Partials       80       80           
Flag Coverage Δ
integration 61.12% <55.55%> (ø)
unit 74.23% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddc34d0...bff9e16. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the misnamed config.swagger namespace to config.openapi to better reflect that it gates the OpenAPI JSON spec endpoint (/api/spec.json) rather than any Swagger-UI surface, with no intended behavior change.

Changes:

  • Renamed config keys: config.swagger → config.openapi, and publicInProd → public (secure-by-default remains).
  • Renamed globbed file list key: config.files.swagger → config.files.openapi and updated the config boot filter list accordingly.
  • Updated initApiSpec gate/log prefixes and refreshed affected unit tests + added a migration note for downstream consumers.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
modules/core/tests/core.unit.tests.js Updates core unit tests to use config.openapi and config.files.openapi, including updated log prefix assertions.
MIGRATIONS.md Documents the breaking config rename and downstream /update-stack action required.
lib/services/tests/express.openapi-servers.unit.tests.js Updates mocked config shape to the new openapi namespace.
lib/services/tests/express.errorroutes.unit.tests.js Updates mocked config shape to the new openapi namespace.
lib/services/tests/express.docsEnvGate.unit.tests.js Updates env-gate tests to assert the new config.openapi.* behavior/semantics.
lib/services/tests/express.docs.unit.tests.js Updates OpenAPI spec endpoint unit tests to use openapi/files.openapi.
lib/services/express.js Switches initApiSpec gating and log prefixes to config.openapi and config.files.openapi.
lib/helpers/config.js Renames globbed YAML list from files.swagger to files.openapi.
config/index.js Updates the fileKeys filter list to openapi instead of swagger.
config/defaults/production.config.js Renames default config namespace to openapi (disabled by default in prod).
config/defaults/development.config.js Renames default config namespace to openapi and publicInProd → public.

@PierreBrisorgueil
PierreBrisorgueil merged commit e4d7241 into master Jun 16, 2026
9 checks passed
@PierreBrisorgueil
PierreBrisorgueil deleted the refactor/config-swagger-to-openapi branch June 16, 2026 14:50
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