Skip to content

Commit

Permalink
Wrapped params in Hapi routes with Joi.object to ensure compatibility…
Browse files Browse the repository at this point in the history
… with v16.x
  • Loading branch information
mdebarros committed Sep 19, 2019
1 parent 971c1f2 commit 5e6261f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/api/transfers/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ module.exports = [{
'fspiop-uri': Joi.string().optional(),
'fspiop-http-method': Joi.string().optional()
}).unknown(false).options({ stripUnknown: true }),
params: {
params: Joi.object({
id: Joi.string().required().description('path')
},
}),
payload: Joi.object({
fulfilment: Joi.string().regex(/^[A-Za-z0-9-_]{43}$/).max(48).description('fulfilment of the transfer').label('Invalid transfer fulfilment description.'),
completedTimestamp: Joi.string().regex(/^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:(\.\d{3}))(?:Z|[+-][01]\d:[0-5]\d)$/).description('When the transfer was completed').label('A valid transfer completion date must be supplied.'),
Expand Down Expand Up @@ -147,9 +147,9 @@ module.exports = [{
'fspiop-uri': Joi.string().optional(),
'fspiop-http-method': Joi.string().optional()
}).unknown(false).options({ stripUnknown: true }),
params: {
params: Joi.object({
id: Joi.string().required().description('path')
},
}),
payload: Joi.object({
errorInformation: Joi.object().keys({
errorDescription: Joi.string().required(),
Expand Down Expand Up @@ -187,9 +187,9 @@ module.exports = [{
'fspiop-uri': Joi.string().optional(),
'fspiop-http-method': Joi.string().optional()
}).unknown(false).options({ stripUnknown: true }),
params: {
params: Joi.object({
id: Joi.string().guid().required().description('path').label('Supply a valid transfer Id to continue.') // To Do : expand user friendly error msg to params as well
}
})
}
}
}
Expand Down

0 comments on commit 5e6261f

Please sign in to comment.