From 49169af40f9082503e26014323d7873994feef6d Mon Sep 17 00:00:00 2001 From: sheetalm Date: Thu, 26 Apr 2018 15:05:17 +0530 Subject: ActivitySpec Add USER_ID header in swagger in Apis Add mandatory USER_ID header parameter to swagger. Change-Id: If517694417611864afb59ddebfef84a12d6da96c Issue-ID: SDC-1048 Signed-off-by: sheetalm --- .../org/onap/sdc/activityspec/api/rest/ActivitySpecs.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'services') diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java index 06b85246af..f6c5486b4d 100644 --- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java +++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java @@ -19,6 +19,8 @@ package org.onap.sdc.activityspec.api.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import org.onap.sdc.activityspec.api.rest.types.ActivitySpecActionRequestDto; import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto; import org.springframework.validation.annotation.Validated; @@ -35,6 +37,8 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.USER_ID_HEADER_PARAM; + @Path("/v1.0/activity-spec/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -45,17 +49,23 @@ public interface ActivitySpecs { @POST @Path("/") @ApiOperation(value = "Create Activity Spec") + @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string", + paramType = "header")}) Response createActivitySpec(@Valid ActivitySpecRequestDto request); @GET @Path("/{id}/versions/{versionId}") @ApiOperation(value = "Get Activity Spec") + @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string", + paramType = "header")}) Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id") String id, @ApiParam(value = "Version Id") @PathParam("versionId") String versionId); @PUT @Path("/{id}/versions/{versionId}") @ApiOperation(value = "Update Activity Spec") + @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string", + paramType = "header")}) Response updateActivitySpec(@Valid ActivitySpecRequestDto request, @ApiParam(value = "Activity Spec Id") @PathParam("id") String id, @ApiParam(value = "Version Id") @PathParam("versionId") String versionId); @@ -65,6 +75,8 @@ public interface ActivitySpecs { @ApiOperation(value = "Actions on a activity spec", notes = "Performs one of the following actions on a activity spec: |" + "CERTIFY: Certifies activity spec.|" + "DEPRECATE: Deprecates activity spec.|" + "DELETE: Deletes activity spec.") + @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string", + paramType = "header")}) Response actOnActivitySpec(ActivitySpecActionRequestDto request, @ApiParam(value = "Activity Spec Id") @PathParam("id") String id, @ApiParam(value = "Version Id") @PathParam("versionId") String versionId); @@ -72,6 +84,8 @@ public interface ActivitySpecs { @GET @Path("/") @ApiOperation(value = "Get list of activity specs ", responseContainer = "List") + @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string", + paramType = "header")}) Response list(@ApiParam(value = "List activity specs based on status filter") @QueryParam("status") String versionStatus); } -- cgit 1.2.3-korg