Skip to content

fix: add ParameterProvider and FlowAnalysisRule to reference_type allowed values#407

Open
pvillard31 wants to merge 1 commit into
Chaffelson:mainfrom
pvillard31:fix/add-parameter-provider-reference-type
Open

fix: add ParameterProvider and FlowAnalysisRule to reference_type allowed values#407
pvillard31 wants to merge 1 commit into
Chaffelson:mainfrom
pvillard31:fix/add-parameter-provider-reference-type

Conversation

@pvillard31
Copy link
Copy Markdown

Summary

  • Adds ParameterProvider and FlowAnalysisRule to the allowed_values list in ControllerServiceReferencingComponentDTO.reference_type setter
  • These component types were added in NiFi 2.x and can reference ControllerServices, but nipyapi's model validation rejects them

Fixes #406

Details

NiFi's DtoFactory.java (lines 1928-1983) sets referenceType based on the component type:

  • Processor ✅ already in allowed_values
  • ControllerService ✅ already in allowed_values
  • ReportingTask ✅ already in allowed_values
  • FlowRegistryClient ✅ already in allowed_values
  • ParameterProvideradded in this PR
  • FlowAnalysisRuleadded in this PR

Note: NiFi's own OpenAPI/Swagger spec enum for this field is also incomplete (only lists Processor, ControllerService, ReportingTask, FlowRegistryClient), so auto-generation from swagger alone won't catch this.

…owed values

NiFi 2.x can return ParameterProvider and FlowAnalysisRule as reference_type
values in ControllerServiceReferencingComponentDTO when a ParameterProvider
or FlowAnalysisRule references a ControllerService. The current allowed_values
list only includes Processor, ControllerService, ReportingTask, and
FlowRegistryClient, causing a ValueError during deserialization.

This is confirmed by NiFi source code (DtoFactory.java lines 1966-1973 for
ParameterProvider and lines 1957-1965 for FlowAnalysisRule).
@ottobackwards
Copy link
Copy Markdown
Collaborator

My concern here is if this will survive the next generation if it has not been fixed in NiFi. @Chaffelson will need to confirm. I will kick the workflow though.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.13%. Comparing base (7f85f00) to head (44f3761).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
- Coverage   76.81%   75.13%   -1.68%     
==========================================
  Files          41       41              
  Lines        4831     4831              
==========================================
- Hits         3711     3630      -81     
- Misses       1120     1201      +81     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pvillard31
Copy link
Copy Markdown
Author

apache/nifi#11133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: ParameterProvider not in allowed reference_type values for ControllerServiceReferencingComponentDTO

2 participants