-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: handle application/x-www-form-urlencoded format on POSTS #371
Conversation
matteo-cristino
commented
Oct 7, 2024
- chore: add Unsupported Media Type response and refactor the error reponse
- feat: handle application/x-www-form-urlencoded format on POSTS
- fix: typo
- test: content_type metadata field
src/responseUtils.ts
Outdated
LOG: Logger<ILogObj>, | ||
e: Error, | ||
statusCode: string, | ||
msg: string | undefined = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to have a function (response maybe too generic) I would use a type for these fields... So you can have validation over the values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to have string literal types for statusCode
and msg
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes more an enum like: https://gist.github.com/scokmen/f813c904ef79022e84ab2409574d1b45?permalink_comment_id=4581061#gistcomment-4581061
and msg could also be an enum of string/list!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left msg
as a simple string since it can comes from the error and thus it has no prefixed values.
Moreover I would like to extend the use of httpResponse everywhere, but this require more time since it is not obvious how to handle custom response codes and headers (that can comes from the contract metadata). Thus will address it in a different PR
# [1.39.0](v1.38.1...v1.39.0) (2024-10-16) ### Features * handle application/x-www-form-urlencoded format on POSTS ([#371](#371)) ([aaaf48b](aaaf48b))
🎉 This PR is included in version 1.39.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |