[
https://issues.apache.org/jira/browse/NIFI-16464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Chaffelson reassigned NIFI-16464:
----------------------------------------
Assignee: Daniel Chaffelson
> AffectedComponentEntity referenceType OpenAPI enum omits STATELESS_GROUP
> ------------------------------------------------------------------------
>
> Key: NIFI-16464
> URL: https://issues.apache.org/jira/browse/NIFI-16464
> Project: Apache NiFi
> Issue Type: Bug
> Components: NiFi API
> Affects Versions: 2.12.0
> Reporter: Daniel Chaffelson
> Assignee: Daniel Chaffelson
> Priority: Minor
>
> h1. Summary
> While updating nipyapi for NiFi 2.12.0, I found that
> `AffectedComponentEntity.referenceType` omits `STATELESS_GROUP` from its
> OpenAPI enum, although `AffectedComponentDTO.referenceType` includes it.
> The 2.12.0 schema declares:
> ```text
> AffectedComponentEntity.referenceType:
> PROCESSOR, CONTROLLER_SERVICE, INPUT_PORT, OUTPUT_PORT,
> REMOTE_INPUT_PORT, REMOTE_OUTPUT_PORT
> AffectedComponentDTO.referenceType:
> PROCESSOR, CONTROLLER_SERVICE, INPUT_PORT, OUTPUT_PORT,
> REMOTE_INPUT_PORT, REMOTE_OUTPUT_PORT, STATELESS_GROUP
> ```
> This value is also used in the implementation:
> `DtoFactory.createAffectedComponentEntity(ProcessGroupEntity)` sets the
> entity's `referenceType` to `COMPONENT_TYPE_STATELESS_GROUP`.
> h1. Reproduction and impact
> Compare these paths in the NiFi 2.12.0 OpenAPI JSON:
> ```text
> components.schemas.AffectedComponentEntity.properties.referenceType.enum
> components.schemas.AffectedComponentDTO.properties.referenceType.enum
> ```
> The DTO has the additional value `STATELESS_GROUP`; the entity does not.
> An enum-validating generated client rejects this value. In the generated
> Python model before the downstream workaround, this synthetic construction:
> ```python
> AffectedComponentEntity(reference_type="STATELESS_GROUP")
> ```
> raises:
> ```text
> ValueError: Invalid value for `reference_type` (STATELESS_GROUP), must be one
> of ['PROCESSOR', 'CONTROLLER_SERVICE', 'INPUT_PORT', 'OUTPUT_PORT',
> 'REMOTE_INPUT_PORT', 'REMOTE_OUTPUT_PORT']
> ```
> `ParameterContextUpdateRequestDTO` and
> `ParameterProviderApplyParametersRequestDTO` both expose
> `Set<AffectedComponentEntity>` through `referencingComponents`. Clients
> validating those entities can therefore reject the value even though the
> server implementation supports it.
> This report is based on schema inspection, source inspection and synthetic
> client-model validation, not a live endpoint reproduction.
> h1. Expected behaviour and proposed fix
> Include `AffectedComponentDTO.COMPONENT_TYPE_STATELESS_GROUP` in the
> `@Schema.allowableValues` on `AffectedComponentEntity.getReferenceType()`,
> preserving the six existing values.
> Add a focused regression check for the annotation or generated schema.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)