fix(api): Validate static data value for resource workflow (#3736)

This commit is contained in:
Ricardo Espinoza
2022-07-20 02:57:29 -04:00
committed by GitHub
parent 994c89a6c6
commit 7ba9a055cd
2 changed files with 18 additions and 2 deletions

View File

@@ -64,6 +64,17 @@ function createApiRouter(
validate: (identifier: string) =>
validator.isUUID(identifier) || validator.isEmail(identifier),
},
{
name: 'jsonString',
validate: (data: string) => {
try {
JSON.parse(data);
return true;
} catch (e) {
return false;
}
},
},
],
validateSecurity: {
handlers: {