Skip to content

fix: handle empty mime type in insomnia importer - #7828

Merged
naman-bruno merged 1 commit into
usebruno:mainfrom
prateek-bruno:insomnia-v4-import-mimeType
May 13, 2026
Merged

naman-bruno merged 1 commit into
usebruno:mainfrom
prateek-bruno:insomnia-v4-import-mimeType

Conversation

@prateek-bruno

@prateek-bruno prateek-bruno commented Apr 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

BRU-3143

When Insomnia had mimeType as '' for 'Other' body type, we were not handling it.

Now we treat the "Other" body type as "Text" in bruno while importing.

Fixes #7825

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of Insomnia request bodies with empty or missing MIME types during conversion to ensure accurate body mode detection.
  • Tests

    • Added comprehensive test coverage for empty MIME type scenarios across Insomnia v5 and standard collection formats.

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

The PR fixes a bug where Insomnia request bodies with empty mimeType but populated text were lost during Bruno conversion. The logic now detects and properly handles plain-text bodies when mimeType is missing or empty, and includes comprehensive test coverage for both Insomnia v4 and v5 formats.

Changes

Cohort / File(s) Summary
Conversion Logic
packages/bruno-converters/src/insomnia/insomnia-to-bruno.js
Modified body conversion to detect plain-text requests when mimeType is empty/undefined but request.body?.text is present, ensuring body.mode is set to 'text' and text content is preserved.
Test Coverage
packages/bruno-converters/tests/insomnia/insomnia-collection.spec.js, packages/bruno-converters/tests/insomnia/insomnia-collection-v5.spec.js
Added test cases validating that empty mimeType with non-empty text converts to mode: 'text', and empty mimeType with empty text converts to mode: 'none', for both Insomnia v4 and v5 formats.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

size/S

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

📦 When mimeType hides its face,
Text was lost without a trace!
Now we catch it, dark or light,
Import's fixed—our data's tight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: fixing the handling of empty MIME types in the Insomnia importer, which aligns with the core objective.
Linked Issues check ✅ Passed The code changes directly address issue #7825 by handling empty mimeType values in Insomnia imports, treating 'Other' bodies with empty mimeType as text to preserve request body content during migration.
Out of Scope Changes check ✅ Passed All changes are focused on fixing empty mimeType handling in the Insomnia importer with appropriate test coverage for both v4 and v5 formats; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@naman-bruno
naman-bruno merged commit 9f75959 into usebruno:main May 13, 2026
10 checks passed
sharan-bruno pushed a commit to sharan-bruno/bruno that referenced this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import Insomnia v4 data lost text in request body

3 participants