diff --git a/packages/cli/src/PublicApi/index.ts b/packages/cli/src/PublicApi/index.ts index 19681e798d8fe..b416b865104ce 100644 --- a/packages/cli/src/PublicApi/index.ts +++ b/packages/cli/src/PublicApi/index.ts @@ -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: { diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml index c15ce8120b566..bac8120af854d 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml @@ -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: