[
https://issues.apache.org/jira/browse/NIFI-13835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Chaffelson resolved NIFI-13835.
--------------------------------------
Fix Version/s: 1.27.0
Resolution: Fixed
Review of the client generated from 1.27 shows this is resolved.
> Swagger file for uploadProcessGroup contains multiple 'body' parameters
> -----------------------------------------------------------------------
>
> Key: NIFI-13835
> URL: https://issues.apache.org/jira/browse/NIFI-13835
> Project: Apache NiFi
> Issue Type: Bug
> Components: Flow Versioning
> Affects Versions: 1.23.0
> Reporter: Daniel Chaffelson
> Priority: Minor
> Fix For: 1.27.0
>
>
> The Swagger file for the {{uploadProcessGroup}} function contains multiple
> 'body' parameters, which prevents correct documentation and usage. This issue
> seems to stem from the following method in the
> [{{flow.service.ts}}|https://github.com/apache/nifi/blob/c624ccc5e5f23cfdee13d75168eddf564c7f3e36/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/service/flow.service.ts#L210]
> file:
> {code:java}
> uploadProcessGroup(processGroupId = 'root', uploadProcessGroup:
> UploadProcessGroupRequest): Observable<any> {
> const payload = new FormData();
> payload.append('id', processGroupId);
> payload.append('groupName', uploadProcessGroup.name);
> payload.append('positionX', uploadProcessGroup.position.x.toString());
> payload.append('positionY', uploadProcessGroup.position.y.toString());
> payload.append('clientId', uploadProcessGroup.revision.clientId);
> payload.append(
> 'disconnectedNodeAcknowledged',
> String(this.clusterConnectionService.isDisconnectionAcknowledged())
> );
> payload.append('file', uploadProcessGroup.flowDefinition);
> return this.httpClient.post(
> `${FlowService.API}/process-groups/${processGroupId}/process-groups`,
> payload
> );
> }
> {code}
>
> Currently the resulting parameters look like this, note the 'name' fields:
>
> "parameters" : [ {
> "name" : "id",
> "in" : "path",
> "description" : "The process group id.",
> "required" : true,
> "type" : "string"
> }, {
> "in" : "body",
> "name" : "body",
> "description" : "The process group name.",
> "required" : true,
> "schema" : {
> "type" : "string"
> }
> }, {
> "in" : "body",
> "name" : "body",
> "description" : "The process group X position.",
> "required" : true,
> "schema" : {
> "type" : "number",
> "format" : "double"
> }
> }, {
> "in" : "body",
> "name" : "body",
> "description" : "The process group Y position.",
> "required" : true,
> "schema" : {
> "type" : "number",
> "format" : "double"
> }
> }, {
> "in" : "body",
> "name" : "body",
> "description" : "The client id.",
> "required" : true,
> "schema" : {
> "type" : "string"
> }
> }, {
> "in" : "body",
> "name" : "body",
> "description" : "Acknowledges that this node is disconnected to allow for
> mutable requests to proceed.",
> "required" : false,
> "schema" : {
> "type" : "boolean"
> }
> }
>
> To resolve this issue, each property should have a unique and descriptive
> name in the FormData payload. This change will ensure that the Swagger file
> correctly documents these properties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)