@@ -417,6 +417,39 @@ Key: 'Workflow.States[3].BaseState.Transition.NextState' Error:Field validation
417
417
StructLevelValidationCtx (t , testCases )
418
418
}
419
419
420
+ func TestDataInputSchemaStructLevelValidation (t * testing.T ) {
421
+ baseWorkflow := buildWorkflow ()
422
+
423
+ operationState := buildOperationState (baseWorkflow , "start state" )
424
+ buildEndByState (operationState , true , false )
425
+ action1 := buildActionByOperationState (operationState , "action 1" )
426
+ buildFunctionRef (baseWorkflow , action1 , "function 1" )
427
+
428
+ testCases := []ValidationCase {
429
+ {
430
+ Desp : "empty DataInputSchema" ,
431
+ Model : func () Workflow {
432
+ model := baseWorkflow .DeepCopy ()
433
+ model .DataInputSchema = & DataInputSchema {}
434
+ return * model
435
+ },
436
+ Err : `workflow.dataInputSchema.schema is required` ,
437
+ },
438
+ {
439
+ Desp : "filled Schema, default failOnValidationErrors" ,
440
+ Model : func () Workflow {
441
+ model := baseWorkflow .DeepCopy ()
442
+ model .DataInputSchema = & DataInputSchema {
443
+ Schema : "sample schema" ,
444
+ }
445
+ return * model
446
+ },
447
+ },
448
+ }
449
+
450
+ StructLevelValidationCtx (t , testCases )
451
+ }
452
+
420
453
func TestSecretsStructLevelValidation (t * testing.T ) {
421
454
baseWorkflow := buildWorkflow ()
422
455
0 commit comments