-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): validate tasks and triggers with dynamic properties
- Loading branch information
1 parent
6890062
commit b03ab07
Showing
10 changed files
with
185 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
...ns/extractors/PropertyValueExtractor.java → ...dels/property/PropertyValueExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
package io.kestra.core.validations.extractors; | ||
package io.kestra.core.models.property; | ||
|
||
import io.kestra.core.models.property.Property; | ||
import io.micronaut.context.annotation.Context; | ||
import jakarta.validation.valueextraction.ExtractedValue; | ||
import jakarta.validation.valueextraction.ValueExtractor; | ||
|
||
/** | ||
* Jakarta Bean Validation value extractor for a Property.<br> | ||
* | ||
* This is used by the @{@link io.kestra.core.validations.factory.CustomValidatorFactoryProvider}. | ||
*/ | ||
@Context | ||
public class PropertyValueExtractor implements ValueExtractor<Property<@ExtractedValue ?>> { | ||
|
||
@Override | ||
public void extractValues(Property<?> originalValue, ValueReceiver receiver) { | ||
// this will disable validation at save time but enable it at runtime when the value would be populated | ||
receiver.value( null, originalValue.getValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.