Skip to content

feat: decode msgpack response type to JSON #4704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ryanshepps
Copy link

@ryanshepps ryanshepps commented May 18, 2025

Fixes: #372

Description

Decodes a msgpack response to JSON.

Useful links:

Open to any comments/suggestions.

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.

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.

@helloanoop
Copy link
Contributor

This looks good @ryanshepps !

Would you mind also adding a unit test to verify the formatResponse behavior with msgpack? You can create a new test file at: packages/bruno-app/src/components/ResponsePane/QueryResult/index.spec.js

To enable testing, please export the formatResponse function like so:
export const formatResponse = (data, dataBuffer, encoding, mode, filter) => {

@pull-request-size pull-request-size bot added size/L and removed size/S labels May 20, 2025
@ryanshepps
Copy link
Author

This looks good @ryanshepps !

Would you mind also adding a unit test to verify the formatResponse behavior with msgpack? You can create a new test file at: packages/bruno-app/src/components/ResponsePane/QueryResult/index.spec.js

To enable testing, please export the formatResponse function like so: export const formatResponse = (data, dataBuffer, encoding, mode, filter) => {

@helloanoop Added unit tests in 1b9abf0. Note that Jest was giving me trouble when testing formatResponse from index.js since it has jsx in it, so I moved formatResponse into a utils.js file.

Let me know if this doesn't fit the rest of the codebase. Feel free to make/request changes.

@ryanshepps
Copy link
Author

@helloanoop Any requested changes for this? Sorry, I know you're busy.

Its-treason added a commit to Its-treason/bruno that referenced this pull request May 27, 2025
@helloanoop
Copy link
Contributor

Thank you @ryanshepps !
We should have this merged over the next few days.

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.

[Bug/Feature] Allow msgpack as response type (de-serialize to JSON)
2 participants