Ivan Roskoshnyi
05/19/2022, 9:12 AMmiddy-validator
to validate requests in SST
is there a way to add custom message? Also...is it related to middy or JSON schema validation
? Tried to google it but found nothingArpad
05/19/2022, 9:17 AMEdward Asquith
05/19/2022, 10:32 AMArpad
05/19/2022, 11:23 AMEdward Asquith
05/19/2022, 11:26 AM@middy/http-json-body-parser
and @middy/http-error-handler
but my experience was that the setup code to get the types right was probably more than I would have saved by simply adding a few lines the parse the body and run it through a validator myself.Robert Wettlaufer
05/19/2022, 11:46 PMerrorMessage
"properties": {
"token": {
"type": "string",
"minLength": 50,
"errorMessage": "The API Token is required and must be a string greater than 50 characters"
},
In the newest version they don’t include ajv-errors by default and have to import it separately and pass it in. The docs on how to do this were not working for me tbh, and just had to pin the old version and use that and move on