Skip to content

fix: openapi query param import - #6241

Merged
sid-bruno merged 3 commits into
usebruno:mainfrom
pooja-bruno:fix/openapi-query-param-import
Jan 21, 2026
Merged

sid-bruno merged 3 commits into
usebruno:mainfrom
pooja-bruno:fix/openapi-query-param-import

Conversation

@pooja-bruno

@pooja-bruno pooja-bruno commented Nov 28, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Fixes #5352

This PR fixes a bug in the OpenAPI importer where query parameters with object schemas (referenced via $ref or defined inline) were being imported as a single parameter with the schema name, instead of being expanded into their individual properties.

JIRA

Contribution Checklist:

  • 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.
Screen.Recording.2025-11-28.at.1.41.07.PM.mov

Summary by CodeRabbit

  • New Features

    • OpenAPI conversion now expands object-type parameters into individual sub-parameters derived from the object's properties; each generated parameter gets the property name, description, and enabled/required status from the parent schema.
  • Tests

    • Added tests validating expansion of referenced object-schema parameters into discrete query parameters and their descriptions and required flags.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This change modifies OpenAPI parameter conversion to expand parameters whose schema is an object into individual parameters for each property (using property name, description, and required→enabled). Non-object parameters keep the prior handling for query, path, and header locations.

Changes

Cohort / File(s) Summary
Parameter expansion logic
packages/bruno-converters/src/openapi/openapi-to-bruno.js
Adds branching in parameter processing to detect object schemas with schema.properties and emit one param per property (name, description, enabled based on required). Falls back to existing logic for non-object params.
Test coverage
packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-to-bruno.spec.js
Adds a test that verifies a $ref-based object parameter (PaginationParams) is expanded into date, page, and size query parameters with correct descriptions and enabled flags. Minor test formatting tweaks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

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

Poem

Objects split into fields, crisp and keen,
Each property steps out, no longer unseen,
Params once bundled now march in a row,
Schemas unfolding in tidy tableau. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The linked issue #5352 is about disabling auto-redirect for requests, but the PR changes OpenAPI query parameter handling for object schemas—these are unrelated. Verify the correct issue is linked. The PR should reference issue #5352 if that's the intended scope, or link to the actual OpenAPI parameter expansion issue instead.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: openapi query param import' accurately describes the main change: fixing OpenAPI query parameter import handling for object schemas.
Out of Scope Changes check ✅ Passed All changes are focused on expanding object-type OpenAPI parameters into individual properties and corresponding test coverage—no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@sid-bruno
sid-bruno merged commit 75e1761 into usebruno:main Jan 21, 2026
FraCata00 pushed a commit to FraCata00/bruno that referenced this pull request Feb 9, 2026
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 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.

Disable auto redirect for a Request

2 participants