MINIFICPP-2885 Allow explictily unsetting properties with default value - #2241
Open
martinzink wants to merge 5 commits into
Open
MINIFICPP-2885 Allow explictily unsetting properties with default value#2241martinzink wants to merge 5 commits into
martinzink wants to merge 5 commits into
Conversation
martinzink
commented
Aug 11, 2026
Comment on lines
+384
to
+385
| } else { | ||
| validateComponentProperties(*processor, procCfg.name, ""); |
Member
Author
There was a problem hiding this comment.
martinzink
commented
Aug 11, 2026
Comment on lines
+938
to
+949
| 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()); | ||
| } |
Member
Author
There was a problem hiding this comment.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit unsetting of optional property defaults and validates processors whose Properties section is omitted.
Changes:
- Adds APIs for clearing property defaults.
- Handles null YAML/JSON property values.
- Adds a test processor and configuration tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
minifi-api/include/minifi-cpp/core/Property.h |
Adds default-value clearing. |
minifi-api/include/minifi-cpp/core/ConfigurableComponent.h |
Exposes the clearing API. |
core-framework/include/core/ConfigurableComponentImpl.h |
Declares the implementation. |
core-framework/src/core/ConfigurableComponentImpl.cpp |
Implements default clearing. |
libminifi/src/core/flow/StructuredConfiguration.cpp |
Handles null values and omitted properties. |
extensions/stable-api-testing/PropertyTester.h |
Defines the test processor. |
extensions/stable-api-testing/ExtensionInitializer.cpp |
Registers the test processor. |
extensions/stable-api-testing/tests/ConfigTests.cpp |
Tests validation and unsetting behavior. |
Suppressed comments (2)
extensions/stable-api-testing/tests/ConfigTests.cpp:153
- These trailing commas make the payload invalid JSON;
AdaptiveConfigurationtherefore takes its YAML fallback path. This means the purported JSON success case does not cover the JSON parser/node implementation. Remove both trailing commas.
},
}
extensions/stable-api-testing/tests/ConfigTests.cpp:205
- These trailing commas cause RapidJSON parsing to fail and the adaptive parser to treat the payload as YAML, so this test never verifies JSON
nullunsetting. Remove both trailing commas to exercise the intended JSON path.
},
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
adamdebreceni
approved these changes
Aug 11, 2026
lordgamez
approved these changes
Aug 11, 2026
fgerlits
reviewed
Aug 11, 2026
Co-authored-by: Ferenc Gerlits <fgerlits@users.noreply.github.com>
szaszm
approved these changes
Aug 11, 2026
szaszm
left a comment
Member
There was a problem hiding this comment.
let's not include this in 1.0, but +1 afterwards
8 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also fixes MINIFICPP-2884 Omitting Properties entierly skips component validation
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.