Skip to content

Fix multipart/form-data codegen missing --form flag for file fields#808

Merged
KhudaDad414 merged 1 commit intopostmanlabs:developfrom
dashrathky01:fix/update-postman-cli-codegen-form-data-handling
Feb 3, 2026
Merged

Fix multipart/form-data codegen missing --form flag for file fields#808
KhudaDad414 merged 1 commit intopostmanlabs:developfrom
dashrathky01:fix/update-postman-cli-codegen-form-data-handling

Conversation

@dashrathky01
Copy link
Contributor

@dashrathky01 dashrathky01 commented Feb 3, 2026

This pull request updates the handling and testing of multipart/form-data fields in the Postman CLI code generation logic. The main focus is on improving how file fields are represented in generated CLI snippets and ensuring that both text and file fields are correctly converted.

Multipart/form-data handling improvements:

  • Updated addFormDataBody in codegens/postman-cli/lib/index.js to generate CLI snippets using the correct --form flag format for file uploads, removing unnecessary inner double quotes around file paths.

Testing enhancements:

  • Modified existing tests in codegens/postman-cli/test/unit/convert.test.js to expect the new --form flag format and verify the absence of inner double quotes for file paths.
  • Added a new test to ensure that each field (both text and file) in a multipart/form-data request is represented with its own --form flag, and that file paths are formatted correctly without extra quotes.

@KhudaDad414 KhudaDad414 merged commit df6bd3e into postmanlabs:develop Feb 3, 2026
168 of 174 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants