From 38b3b95830568296bde457cd33f79277765f5704 Mon Sep 17 00:00:00 2001 From: Wojciech Sliwka Date: Wed, 3 Jul 2019 08:38:28 +0200 Subject: Migrate swagger to openapi v3 Issue-ID: SDC-2261 Change-Id: I614c15878b9d165a4468570e8318867632c88434 Signed-off-by: Wojciech Sliwka --- .../sdcrests/itempermissions/rest/ItemPermissions.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java index 020eb347d7..866fa885cc 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java @@ -21,8 +21,13 @@ package org.openecomp.sdcrests.itempermissions.rest; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto; import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsRequestDto; import org.springframework.validation.annotation.Validated; @@ -42,22 +47,19 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG @Path("/v1.0/items/{itemId}/permissions") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -@Api(value = "Item Permissions") +@OpenAPIDefinition(info = @Info(title = "Item Permissions")) @Validated public interface ItemPermissions { @GET @Path("/") - @ApiOperation(value = "List users permissions assigned on item", - response = ItemPermissionsDto.class, - responseContainer = "List") - + @Operation(description = "List users permissions assigned on item",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ItemPermissionsDto.class))))) Response list(@PathParam("itemId") String itemId, @HeaderParam(USER_ID_HEADER_PARAM) String user); @PUT @Path("/{permission}") - @ApiOperation(value = "Update useres permission on item") + @Operation(description = "Update useres permission on item") Response updatePermissions(@Valid ItemPermissionsRequestDto request, @PathParam("itemId") String itemId, @PathParam("permission") String permission, -- cgit 1.2.3-korg