mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(api): Validate static data value for resource workflow (#3736)
This commit is contained in:
@@ -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
|
||||
example: '{ iterationId: 2 }'
|
||||
anyOf:
|
||||
- type: string
|
||||
format: 'jsonString'
|
||||
nullable: true
|
||||
- type: object
|
||||
nullable: true
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
|
||||
Reference in New Issue
Block a user