From c4e2ac7cda45591d357519217687aa7979bae8fb Mon Sep 17 00:00:00 2001 From: Kevin Doran Date: Tue, 23 Jan 2018 09:59:58 -0500 Subject: [PATCH] NIFI-4801 Fixes Swagger spec for uploadTemplate. This closes #2428 --- .../web/api/entity/CreateTemplateRequestEntity.java | 2 +- .../apache/nifi/web/api/ProcessGroupResource.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/CreateTemplateRequestEntity.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/CreateTemplateRequestEntity.java index 1e0ffb35d4..f6836b9bda 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/CreateTemplateRequestEntity.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/CreateTemplateRequestEntity.java @@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlRootElement; /** * A serialized representation of this class can be placed in the entity body of a request to the API. */ -@XmlRootElement(name = "copySnippetRequestEntity") +@XmlRootElement(name = "createTemplateRequestEntity") public class CreateTemplateRequestEntity extends Entity { private String name; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java index b9840f10f9..7c932205b3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java @@ -17,6 +17,8 @@ package org.apache.nifi.web.api; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; @@ -3351,6 +3353,16 @@ public class ProcessGroupResource extends ApplicationResource { @Authorization(value = "Write - /process-groups/{uuid}") } ) + @ApiImplicitParams( + value = { + @ApiImplicitParam( + name = "template", + value = "The binary content of the template file being uploaded.", + required = true, + type = "file", + paramType = "formData") + } + ) @ApiResponses( value = { @ApiResponse(code = 400, message = "NiFi was unable to complete the request because it was invalid. The request should not be retried without modification."),