Skip to content

Comments

fix: correctly handle form and file parameters as requestBody instead of query parameters#61

Merged
parvez3019 merged 2 commits intoparvez3019:mainfrom
VanHai1424:fix/form-param-handling
Jun 3, 2025
Merged

fix: correctly handle form and file parameters as requestBody instead of query parameters#61
parvez3019 merged 2 commits intoparvez3019:mainfrom
VanHai1424:fix/form-param-handling

Conversation

@VanHai1424
Copy link

Issue:
When generating OpenAPI specs, parameters with in value form or file were incorrectly treated as query parameters, causing unexpected parameter objects to appear in the output.

Cause:
The original code used an if condition which didn't clearly separate handling of parameters by their location, leading to form and file parameters being processed as query parameters.

Solution:
Refactor the code to use a switch statement on the parameter’s in value to explicitly handle:

  • form and file parameters by calling appendRequestBody (adding them to requestBody content as form data),

  • body parameters by calling parseRequestBody,

  • Other parameters (query, path, etc.) by calling appendQueryParam.

@parvez3019
Copy link
Owner

Hi, thanks for your valuable contribution. Can you add unit tests and integration tests for the same? so that we can merge this?

@VanHai1424
Copy link
Author

Hi, I have added the unit tests and integration tests as requested. Please review them and let me know if any further changes are needed. Thanks!

@parvez3019 parvez3019 merged commit 7109250 into parvez3019:main Jun 3, 2025
2 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.

3 participants