mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
fix(api): Validate static data value for resource workflow (#3736)
This commit is contained in:
parent
994c89a6c6
commit
7ba9a055cd
|
@ -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: {
|
||||
|
|
|
@ -33,9 +33,14 @@ properties:
|
|||
settings:
|
||||
$ref: './workflowSettings.yml'
|
||||
staticData:
|
||||
type: string
|
||||
example: { lastId: 1 }
|
||||
nullable: true
|
||||
anyOf:
|
||||
- type: string
|
||||
format: 'jsonString'
|
||||
nullable: true
|
||||
- type: object
|
||||
nullable: true
|
||||
example: '{ iterationId: 2 }'
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
|
|
Loading…
Reference in a new issue