-
Notifications
You must be signed in to change notification settings - Fork 22
feat(response)!: keyed/non-keyed responses #400
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
Conversation
31b1c9e to
2662387
Compare
| // 500 (internal server error) | INTERNAL | Response.internalError | ||
| // 503 (service unavailable) | UNAVAILABLE | Response.serviceUnavailable | ||
|
|
||
| export type Status = 200 | 400 | 401 | 403 | 404 | 409 | 429 | 500 | 503; |
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.
not a change req but wanted to point out that we specify 405 in the comment above but can't actually throw it
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 catch, this was here before fwiw
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.
yeah I figured
| 401: 'unauthenticated', | ||
| 403: 'permissionDenied', | ||
| 404: 'notFound', | ||
| 409: 'conflict', |
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.
🎸
manav-c
left a comment
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.
LGTM
Changes - - Rename the "Response" functions to "KeyedResponse" functions to align with conventions within express-wrapper. These functions use string-based "type" values alongside the payload. - Add "Response" functions in place of the original, further aligning with conventions within express-wrapper. These functions use numerical-based "type" values alongside the payload. - Add "conflict" / 409 error code to the possible status that can be returned BREAKING CHANGE: Existing response functions have been renamed to align convention with other packages in this repository.
ee3ffbe to
4de6465
Compare
bitgopatmcl
left a comment
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.
Looks like this breaking change should help with some of the confusing errors that can be generated around responses.
|
🎉 This PR is included in version @api-ts/express-wrapper@1.0.14 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/typed-express-router@1.0.11 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/io-ts-http@2.1.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/response@2.0.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/openapi-generator@1.0.6 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/superagent-wrapper@1.1.8 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Changes
BREAKING CHANGE: Existing response functions have been renamed to align convention with other packages in this repository.