Repository navigation
refactor(config): rename config.swagger → config.openapi (gates the OpenAPI spec, not Swagger-UI) - #3891
Conversation
…OpenAPI spec, not Swagger-UI)
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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, andpublicInProd→public(secure-by-default remains). - Renamed globbed file list key:
config.files.swagger→config.files.openapiand updated the config boot filter list accordingly. - Updated
initApiSpecgate/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. |
Pure rename, no behavior change.
The
config.swaggernamespace 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 inconfig/defaults/development.config.js+production.config.js)config.swagger.publicInProd→config.openapi.public(drops the redundantInProdsuffix; semantics = "serve the spec publicly"; still secure-by-defaultpublic: false)config.files.swaggerglob key →config.files.openapi(lib/helpers/config.js+ thefileKeysfilter inconfig/index.js)initApiSpecgate inlib/services/express.jsreads the new keys; internal log prefixes[swagger]→[openapi]MIGRATIONS.mdentry with the downstream/update-stackactionVerification
eslintclean on all changed files/api/spec.jsonasserted served whenconfig.openapi.publicis true under a prod-grade env, gated otherwise