@@ -384,6 +384,55 @@ func testInvalidComponentSchema(t *testing.T, invalidSchema []byte, expectedLogs
384384 assert .Equal (t , strings .TrimLeft (expectedLogs , "\n " ), logger .AllMessagesTxt ())
385385}
386386
387+ func TestValidateConfig_SkipTransformationComponents (t * testing.T ) {
388+ t .Parallel ()
389+
390+ // Schema that requires "firstName" field
391+ schema := getTestSchema ()
392+
393+ // Content that violates the schema (missing required "firstName")
394+ invalidContent := orderedmap .FromPairs ([]orderedmap.Pair {
395+ {
396+ Key : "parameters" ,
397+ Value : orderedmap .FromPairs ([]orderedmap.Pair {
398+ {Key : "lastName" , Value : "Brown" },
399+ }),
400+ },
401+ })
402+
403+ // Test that validation is skipped for transformation components
404+ transformationComponents := []keboola.ComponentID {
405+ "keboola.python-transformation-v2" ,
406+ "keboola.snowflake-transformation" ,
407+ "keboola.google-bigquery-transformation" ,
408+ }
409+
410+ for _ , componentID := range transformationComponents {
411+ component := & keboola.Component {
412+ ComponentKey : keboola.ComponentKey {ID : componentID },
413+ Type : "transformation" ,
414+ Name : "Test Transformation" ,
415+ Schema : schema ,
416+ }
417+ config := & model.Config {Content : invalidContent }
418+
419+ // Should return nil because validation is skipped for transformation components
420+ err := ValidateConfig (component , config )
421+ require .NoError (t , err , "validation should be skipped for component %s" , componentID )
422+ }
423+
424+ // Verify that a regular component still gets validated
425+ regularComponent := & keboola.Component {
426+ ComponentKey : keboola.ComponentKey {ID : "keboola.ex-generic" },
427+ Type : "extractor" ,
428+ Name : "Generic Extractor" ,
429+ Schema : schema ,
430+ }
431+ config := & model.Config {Content : invalidContent }
432+ err := ValidateConfig (regularComponent , config )
433+ require .Error (t , err , "validation should NOT be skipped for regular component" )
434+ }
435+
387436func TestNormalizeSchema_RequiredTrue (t * testing.T ) {
388437 t .Parallel ()
389438
0 commit comments