fix:populate collection & folder docs on OpenAPI/swagger imports#8767
fix:populate collection & folder docs on OpenAPI/swagger imports#8767adwait-bruno wants to merge 1 commit into
Conversation
WalkthroughOpenAPI and Swagger 2.0 converters now import collection descriptions and tag descriptions into generated Bruno collections and folders. A shared sanitized tag-description helper supports both converters, with Jest coverage for populated, missing, and preserved documentation. ChangesOpenAPI documentation import
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js (1)
99-105: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert absent collection docs exactly.
The current predicates accept
nullor'', so a converter that emits docs rather than leaving them unset still passes. AsserttoBeUndefined()in both suites.
packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js#L99-L105: replace the permissive root-doc assertion withexpect(result.root.docs).toBeUndefined().packages/bruno-converters/tests/openapi/swagger2-to-bruno/swagger2-docs.spec.js#L81-L87: replace the permissive root-doc assertion withexpect(result.root.docs).toBeUndefined().🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js` around lines 99 - 105, In the no-description documentation tests, require root docs to be absent exactly: update the root assertion in packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js lines 99-105 and packages/bruno-converters/tests/openapi/swagger2-to-bruno/swagger2-docs.spec.js lines 81-87 to use toBeUndefined(), while preserving the existing folder-doc assertions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js`:
- Around line 99-105: In the no-description documentation tests, require root
docs to be absent exactly: update the root assertion in
packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.js
lines 99-105 and
packages/bruno-converters/tests/openapi/swagger2-to-bruno/swagger2-docs.spec.js
lines 81-87 to use toBeUndefined(), while preserving the existing folder-doc
assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 23cec2df-3d46-47d9-a1cc-a356089f6a54
📒 Files selected for processing (5)
packages/bruno-converters/src/openapi/openapi-common.jspackages/bruno-converters/src/openapi/openapi-to-bruno.jspackages/bruno-converters/src/openapi/swagger2-to-bruno.jspackages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-docs.spec.jspackages/bruno-converters/tests/openapi/swagger2-to-bruno/swagger2-docs.spec.js
Description
REF:BRU-1429
OpenAPI import only copied request-level descriptions into Docs tabs,info.description (collection) and top-level tags[].description (folders)were never read, leaving those Docs tabs empty.
Read info.description into collection root docs and match top-level tags[] descriptions to their folders via a shared getTagDescriptions helper (keyed by sanitized tag name so it lines up with folder names).Applied to both the OpenAPI 3.x and Swagger 2.0 converters.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.


Collection-Level:
Folder-Level:
Summary by CodeRabbit
New Features
Bug Fixes
Tests