Skip to content

Commit

Permalink
fix(output-validation): šŸ› return the untransformed response when no rā€¦
Browse files Browse the repository at this point in the history
ā€¦esponse validation schema has been provided
  • Loading branch information
evertdespiegeleer committed Oct 11, 2024
1 parent 2585761 commit 5baae32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/util/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const endpointToExpressHandler = (endpoint: AnyEndpoint) => {
.getHandler()?.(inputParams, req, res)
.then((responseObj) => {
// Output validation
let postOutputValidationResponseObj: z.output<ReturnType<typeof endpoint.getResponseValidationSchema>> | undefined
let postOutputValidationResponseObj: z.output<ReturnType<typeof endpoint.getResponseValidationSchema>> = responseObj
try {
postOutputValidationResponseObj = endpoint.getResponseValidationSchema()?.parse(responseObj)
} catch (error) {
Expand Down

0 comments on commit 5baae32

Please sign in to comment.