summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2019-07-03 08:38:28 +0200
committerTomasz Golabek <tomasz.golabek@nokia.com>2019-07-23 11:33:02 +0000
commit38b3b95830568296bde457cd33f79277765f5704 (patch)
tree0dea07cbf7469f3c1f4b93d04510312ec86226e6 /openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src
parenta73cbca41fbba96855173f39c89c04d50d4d8672 (diff)
Migrate swagger to openapi v3
Issue-ID: SDC-2261 Change-Id: I614c15878b9d165a4468570e8318867632c88434 Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java
index 5420bda5c0..0f6b7c9c8e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java
@@ -20,9 +20,14 @@
package org.openecomp.sdcrests.notifications.rest.services;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+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.notifications.types.NotificationsStatusDto;
import org.openecomp.sdcrests.notifications.types.UpdateNotificationResponseStatus;
import org.springframework.validation.annotation.Validated;
@@ -39,16 +44,14 @@ import static org.openecomp.sdcrests.common.RestConstants.*;
@Path("/v1.0/notifications")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
-@Api(value = "Notifications")
+@OpenAPIDefinition(info = @Info(title = "Notifications"))
@Validated
public interface Notifications {
String LIMIT_QUERY_PARAM = "NOTIFICATION_ROWS_LIMIT";
String END_OF_PAGE_QUERY_PARAM = "END_OF_PAGE_EVENT_ID";
@GET
- @ApiOperation(value = "Retrive all user notifications",
- response = NotificationsStatusDto.class,
- responseContainer = "List")
+ @Operation(description = "Retrieve all user notifications", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation = NotificationsStatusDto.class)))))
Response getNotifications(
@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user,
@QueryParam(LAST_DELIVERED_QUERY_PARAM) UUID lastDelvered,
@@ -56,27 +59,23 @@ public interface Notifications {
@PUT
@Path("/{notificationId}")
- @ApiOperation(value = "Mark notification as read",
- response = UpdateNotificationResponseStatus.class)
+ @Operation(description = "Mark notification as read", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UpdateNotificationResponseStatus.class))))
Response markAsRead(
- @ApiParam(value = "Notification Id") @PathParam("notificationId") String notificationId,
+ @Parameter(description = "Notification Id") @PathParam("notificationId") String notificationId,
@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
throws InvocationTargetException, IllegalAccessException;
@PUT
@Path("/last-seen/{notificationId}")
- @ApiOperation(value = "Update Last Seen Notification",
- response = UpdateNotificationResponseStatus.class)
+ @Operation(description = "Update Last Seen Notification", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UpdateNotificationResponseStatus.class))))
Response updateLastSeenNotification(
- @ApiParam(value = "Notification Id") @PathParam("notificationId") String notificationId,
+ @Parameter(description = "Notification Id") @PathParam("notificationId") String notificationId,
@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
throws InvocationTargetException, IllegalAccessException;
@GET
@Path("/worker")
- @ApiOperation(value = "Retrive user not delivered notifications",
- response = NotificationsStatusDto.class,
- responseContainer = "List")
+ @Operation(description = "Retrive user not delivered notifications",responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation = NotificationsStatusDto.class)))))
Response getNewNotificationsByOwnerId(
@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user,
@QueryParam(LAST_DELIVERED_QUERY_PARAM) String eventId,