martinzink commented on code in PR #2241:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2241#discussion_r3756387626
##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -936,6 +935,18 @@ void
StructuredConfiguration::parsePropertyNodeElement(const std::string& proper
ParameterContext* parameter_context) {
logger_->log_trace("Encountered {}", property_name);
if (!property_value_node || property_value_node.isNull()) {
+ auto my_prop = component.getSupportedProperty(property_name);
+ if (!my_prop.has_value()) {
+ // Dynamic property fallback for previous workflow
+ return;
+ }
+ if (my_prop->getRequired()) {
+ raiseComponentError(component.getName(), "", "Can't explicitly unset
required property");
+ }
+ const auto prop_def_cleared =
component.clearPropertyDefaultValue(property_name);
+ if (!prop_def_cleared) {
+ raiseComponentError(component.getName(), "",
prop_def_cleared.error().message());
+ }
Review Comment:
[MINIFICPP-2885 Allow explictily unsetting properties with default
value](https://issues.apache.org/jira/browse/MINIFICPP-2885)
--
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]