Skip to content

Conversation

@Art051
Copy link
Contributor

@Art051 Art051 commented May 23, 2025

Description

As outlined in issue 4749, the 'Generate Code' functionality fails when using 'File/Binary' requests.

Existing PR does exist here: #4207, but it does not cover the edge cases mentioned in the issue I raised.

The original issue has images showing the existing state of the 'Generate Code' functionality.


Images for this PR:

File/Binary request with a file selected and checkbox ticked.

file_binary_req
file_binary_gen_code

File/Binary request with a the file field empty and checkbox ticked.

file_binary_no_file_selected_req
file_binary_no_file_selected_gen_code

File/Binary request with an empty request body.

file_binary_no_body_req
file_binary_no_body_gen_code


PR 4207

For reference, these are the results when running the three conditions using the branch in #4207

File/Binary request with a file selected and checkbox ticked.

pr4207_file_binary_gen_code

File/Binary request with a the file field empty and checkbox ticked.

pr4207_file_binary_no_file_selected_gen_code

File/Binary request with an empty request body.

pr4207_file_binary_no_body_gen_code

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.

Art051 added 2 commits May 23, 2025 12:36
need to remove console logs still.

but saving before rectifying the error here:
TypeError: Cannot read properties of undefined (reading 'mode') at getAuthHeaders (http://localhost:3000/static/js/index.js:83116:17) at CodeView (http://localhost:3000/index.38d30042ecc42668.hot-update.js:107:86) at react-stack-bottom-frame (http://localhost:3000/static/js/lib-react.js:12201:18) at renderWithHooks (http://localhost:3000/static/js/lib-react.js:3518:20) at updateFunctionComponent (http://localhost:3000/static/js/lib-react.js:4787:17) at beginWork (http://localhost:3000/static/js/lib-react.js:5405:16) at runWithFiberInDEV (http://localhost:3000/static/js/lib-react.js:746:14) at performUnitOfWork (http://localhost:3000/static/js/lib-react.js:7990:93) at workLoopSync (http://localhost:3000/static/js/lib-react.js:7884:38) at renderRootSync (http://localhost:3000/static/js/lib-react.js:7868:7)
message
:
"Cannot read properties of undefined (reading 'mode')"
stack
:
"TypeError: Cannot read properties of undefined (reading 'mode')\n at getAuthHeaders (http://localhost:3000/static/js/index.js:83116:17)\n at CodeView (http://localhost:3000/index.38d30042ecc42668.hot-update.js:107:86)\n at react-stack-bottom-frame (http://localhost:3000/static/js/lib-react.js:12201:18)\n at renderWithHooks (http://localhost:3000/static/js/lib-react.js:3518:20)\n at updateFunctionComponent (http://localhost:3000/static/js/lib-react.js:4787:17)\n at beginWork (http://localhost:3000/static/js/lib-react.js:5405:16)\n at runWithFiberInDEV (http://localhost:3000/static/js/lib-react.js:746:14)\n at performUnitOfWork (http://localhost:3000/static/js/lib-react.js:7990:93)\n at workLoopSync (http://localhost:3000/static/js/lib-react.js:7884:38)\n at renderRootSync (http://localhost:3000/static/js/lib-react.js:7868:7)"
@lohit-bruno lohit-bruno merged commit 10e872c into usebruno:main Jun 27, 2025
3 checks passed
naman-bruno pushed a commit to naman-bruno/bruno that referenced this pull request Jul 3, 2025
…e-error-with-binary-file-request

Bugfix/4749 generate code error with binary file request
naman-bruno pushed a commit to naman-bruno/bruno that referenced this pull request Jul 17, 2025
…e-error-with-binary-file-request

Bugfix/4749 generate code error with binary file request
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.

4 participants