martinzink commented on code in PR #1965:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1965#discussion_r2109061718
##########
utils/include/core/PropertyDefinitionBuilder.h:
##########
@@ -99,6 +99,17 @@ struct PropertyDefinitionBuilder {
}
constexpr PropertyDefinition<NumAllowedValues, NumDependentProperties,
NumExclusiveOfProperties> build() {
+ if (property.name.size() == 0) {
+ throw std::logic_error("A Property must have a name");
+ }
+ if (property.supports_expression_language) {
+ if (property.allowed_values.size() > 0) {
+ throw std::logic_error("Either supports EL or has allowed values");
+ }
+ if (property.validator !=
&StandardPropertyValidators::NON_BLANK_VALIDATOR && property.validator !=
&StandardPropertyValidators::ALWAYS_VALID_VALIDATOR) {
+ throw std::logic_error("Only ALWAYS_VALID_VALIDATOR and
NON_BLANK_VALIDATOR has EL support");
Review Comment:
I'm not sure if we should allow NON_BLANK_VALIDATOR, on hand it makes sense,
because it can filter out obviously wrong configs during onSchedule, but we
cant rely on it during onTrigger because EL can easily be evaluated to be empty
str
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]