Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-13835

Swagger file for uploadProcessGroup contains multiple 'body' parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.23.0
    • 1.27.0
    • Flow Versioning
    • None

    Description

      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 file:

      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
          );
      }
      

       
      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chaffelson Daniel Chaffelson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: