Consider using `axios` rather than `request`
See original GitHub issueHi,
request
is deprecated since a long time and it’s now common to use axios
. A lot of generated boilerplate could be removed with this change.
Also, request-promise-core
have some unhandled promises which are hanging our apps using @hubspot/api-client
. Changing the request library will fix this. Also, the OpenAPI generator used here is capable of generating clients with axios
so this change would not be that painful.
I clearly understand that this change will cause some sort of big refactor but I think that it is more than relevant to use a well maintained library, especially if you’re relying entirely on it like @hubspot/api-client
do:
"dependencies": {
"bluebird": "^3.7.2",
"bottleneck": "^2.19.5",
"lodash": "^4.17.19",
"request": "^2.88.0"
}
You’ll be able to remove bluebird
, which is nice too.
EDIT: to give more context on why this should be done, some errors are unhandled which is not your fault but is causing some damages. For instance, while trying to edit a CRM contact with a bad id, maybe the error will be catch, maybe not causing the app to hang without being able to catch it:
StatusCodeError: 404 - {"status":"error","message":"resource not found","correlationId":"xxx"}
at new StatusCodeError (../../node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (../../node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (../../node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (../../node_modules/request/request.js:185:22)
at Request.<anonymous> (../../node_modules/request/request.js:1154:10)
at IncomingMessage.<anonymous> (../../node_modules/request/request.js:1076:12)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:8
Hi Everyone We have problems with OpenAPI Generator We are working on it
Having the same problem. Github Dependabot is now throwing security warnings because of this outdated dependency.