Skip to content
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

bug: Fixed issue where form values were being marshalled as string only #148

Merged
merged 3 commits into from
Mar 21, 2022

Conversation

akeemphilbert
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Moved ConvertFormToJson to the context middleware (it isn't used anywhere else)

  • Updated ConvertFormToJson signature to receive schema so that it could be used to coerce the type

  • Updated ConvertFormToJson so that arrays are handled correctly

  • Add ConvertStringToType utility function that could be used to convert OpenAPI data type to golang type

  • Refactored convertProperties so that it uses the new ConvertStringToType utility function so that conversions are consistent. It also reduced the lines of code

  • Fixed the parameter reference in the README.md so that it's correct

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

* Moved ConvertFormToJson to the context middleware (it isn't used anywhere else)
* Updated ConvertFormToJson signature to receive schema so that it could be used to coerce the type
* Updated ConvertFormToJson so that arrays are handled correctly
* Add ConvertStringToType utility function that could be used to convert OpenAPI data type to golang type
* Refactored convertProperties so that it uses the new ConvertStringToType utility function so that conversions are consistent. It also reduced the lines of code
* Fixed the parameter reference in the README.md so that it's correct
* Refactored form data parsing so that the same code could be used for both application/x-www-form-urlencoded and multipart/form-data
* In the getter functions title cased the property name (this was being done for string only)
Copy link
Contributor

@RandyDeo RandyDeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes to middleware context/ConvertFormtoJson would affect WEOS-1378 since it's functionality was done in these functions.

@shaniah868 shaniah868 merged commit 7b0eb30 into dev Mar 21, 2022
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