Skip to content

Commit

Permalink
MOSIP-38883 corrected swagger documentation (#1085)
Browse files Browse the repository at this point in the history
Signed-off-by: Mayura Deshmukh <[email protected]>
  • Loading branch information
mayuradesh authored Jan 10, 2025
1 parent 2a70f9b commit f8c6ff6
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ public class DeviceDetailController {
RequestValidator requestValidator;

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
* It has been replaced by the new POST /securebiometricinterface/{sbiId}/devices endpoint.
* The functionality provided by this API is now available in the new endpoint.
* Please use the new endpoint for all future requests.
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostdevicedetail())")
@ResponseFilter
@PostMapping
@Operation(summary = "Service to save DeviceDetail - deprecated since release-1.3.0.", description = "This API has been deprecated since the 1.3.0 release and replaced by the POST /securebiometricinterface/{sbiId}/devices endpoint.")
@Operation(summary = "Service to save DeviceDetail - deprecated since release-1.3.x.", description = "This endpoint has been deprecated since the release-1.3.x and replaced by the POST /securebiometricinterface/{sbiId}/devices endpoint.")
@ApiResponses({ @ApiResponse(code = 201, message = "When DeviceDetail successfully created"),
@ApiResponse(code = 400, message = "When Request body passed is null or invalid"),
@ApiResponse(code = 500, message = "While creating DeviceDetail any error occured") })
Expand All @@ -113,13 +113,13 @@ public ResponseWrapper<IdDto> createDeviceDetail(
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPutdevicedetail())")
@ResponseFilter
@PutMapping
@Operation(summary = "Service to update DeviceDetails - deprecated since release-1.3.0.", description = "This API has been deprecated since release-1.3.0.")
@Operation(summary = "Service to update DeviceDetails - deprecated since release-1.3.x.", description = "This endpoint has been deprecated since release-1.3.x.")
@ApiResponses({ @ApiResponse(code = 201, message = "When DeviceDetail successfully updated"),
@ApiResponse(code = 400, message = "When Request body passed is null or invalid"),
@ApiResponse(code = 500, message = "While updating DeviceDetail any error occured") })
Expand All @@ -142,17 +142,17 @@ public ResponseWrapper<IdDto> updateDeviceDetail(
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
* It has been replaced by the new PATCH devicedetail/{id}/approval endpoint.
* The functionality provided by this API is now available in the new endpoint.
* Please use the new endpoint for all future requests.
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPatchdevicedetail())")
@ResponseFilter
@PatchMapping
@Operation(summary = "Service to approve/reject DeviceDetail - deprecated since 1.3.0 release.",
description = "This API has been deprecated since the 1.3.0 release and replaced by the PATCH devicedetail/{id}/approval endpoint.")
@Operation(summary = "Service to approve/reject DeviceDetail - deprecated since release-1.3.x.",
description = "This endpoint has been deprecated since the release-1.3.x and replaced by the PATCH /devicedetail/{id}/approval endpoint.")
@ApiResponses({ @ApiResponse(code = 201, message = "When DeviceDetail successfully approved/rejected"),
@ApiResponse(code = 400, message = "When Request body passed is null or invalid"),
@ApiResponse(code = 500, message = "While approving/rejecting DeviceDetail any error occured") })
Expand All @@ -176,17 +176,17 @@ public ResponseWrapper<String> approveDeviceDetails(
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
* It has been replaced by the new GET /devicedetail/search/v2 endpoint.
* The functionality provided by this API is now available in the new endpoint.
* Please use the new endpoint for all future requests.
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@ResponseFilter
@PostMapping("/search")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostdevicedetailsearch())")
@Operation(summary = "Service to search DeviceDetails - deprecated since 1.3.0 release.",
description = "This API has been deprecated since the 1.3.0 release and replaced by the GET /devicedetail/search/v2 endpoint.")
@Operation(summary = "Service to search DeviceDetails - deprecated since release-1.3.x.",
description = "This endpoint has been deprecated since the release-1.3.x and replaced by the GET /devicedetail/search/v2 endpoint.")
public ResponseWrapper<PageResponseDto<DeviceDetailSearchResponseDto>> searchDeviceDetails(
@RequestBody @Valid RequestWrapper<DeviceSearchDto> request) {
ResponseWrapper<PageResponseDto<DeviceDetailSearchResponseDto>> responseWrapper = new ResponseWrapper<>();
Expand All @@ -206,17 +206,17 @@ public ResponseWrapper<PageResponseDto<RegistrationSubTypeDto>> searchDeviceType
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
* It has been replaced by the new GET /devicedetail/search/v2 endpoint.
* The functionality provided by this API is now available in the new endpoint.
* Please use the new endpoint for all future requests.
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@ResponseFilter
@PostMapping("/filtervalues")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostdevicedetailfiltervalues())")
@Operation(summary = "Service to filter DeviceDetails - deprecated since 1.3.0 release.",
description = "This API has been deprecated since the 1.3.0 release and replaced by the GET /devicedetail/search/v2 endpoint.")
@Operation(summary = "Service to filter DeviceDetails - deprecated since release-1.3.x.",
description = "This endpoint has been deprecated since the release-1.3.x and replaced by the GET /devicedetail/search/v2 endpoint.")
public ResponseWrapper<FilterResponseCodeDto> filterValues(
@RequestBody @Valid RequestWrapper<DeviceFilterValueDto> request) {
ResponseWrapper<FilterResponseCodeDto> responseWrapper = new ResponseWrapper<>();
Expand Down Expand Up @@ -249,8 +249,8 @@ public ResponseWrapper<FilterResponseCodeDto> filterDeviceSubType(

@PreAuthorize("hasAnyRole(@authorizedRoles.getPatchdeactivatedevice())")
@PatchMapping(value = "/{deviceId}")
@Operation(summary = "Added in release-1.3.0, This endpoint deactivates a device based on the provided Device ID and status",
description = "This endpoint deactivates a device based on the provided Device ID and status, ensuring the device belongs to the logged-in user. It only allows deactivation for devices with status \"approved\" and is_active as true; other statuses result in an error. Upon deactivation, the device's is_active is set to false while retaining the \"approved\" status. It is accessible to users with the DEVICE_PROVIDER or PARTNER_ADMIN roles.")
@Operation(summary = "This endpoint deactivates a Device based on the Device Id.",
description = "Avaiable since release-1.3.x. This endpoint is configured for the roles DEVICE_PROVIDER or PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
Expand All @@ -267,8 +267,8 @@ public ResponseWrapperV2<DeviceDetailResponseDto> deactivateDevice(@PathVariable

@PreAuthorize("hasAnyRole(@authorizedRoles.getPostdevicewithsbimapping())")
@PostMapping(value = "/{id}/approval")
@Operation(summary = "Added in release-1.3.0, available for Partner Admin, allows user to approve or reject devices and activate the mapping between a device and an SBI",
description = "This endpoint allows Partner Admin users to approve or reject devices and activate the mapping between a device and an SBI. It is exclusively accessible to users with the PARTNER_ADMIN role.")
@Operation(summary = "This endpoint is for the Partner Admin user to approve or reject a Device and activate the mapping between the Device and the SBI.",
description = "Avaiable since release-1.3.x. It is configured for the role PARTNER_ADMIN")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
Expand All @@ -284,7 +284,8 @@ public ResponseWrapperV2<Boolean> approveOrRejectMappingDeviceToSbi(@PathVariabl

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetalldevicedetails())")
@GetMapping(value = "/search/v2")
@Operation(summary = "Added in release-1.3.0, available only for Partner Admin, retrieves a list of all devices created by all partners", description = "This endpoint fetches the list of all devices created by all partners. It enhances the earlier /partners/devicedetail/search endpoint by improving performance, handling deactivated statuses, and adding SBI ID and version details. The API supports pagination, sorting and filtering and is designed exclusively for Partner Admin users.")
@Operation(summary = "This endpoint retrieves a list of all the Devices.",
description = "Avaiable since release-1.3.x. This endpoint supports pagination, sorting, and filtering. It is configured for the role PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public ResponseWrapper<IdDto> createDeviceDetail(
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPutftpchipdetail())")
@ResponseFilter
@PutMapping
@Operation(summary = "Service to update ftp chip detail - deprecated since 1.3.0 release.", description = "This API has been deprecated since 1.3.0 release.")
@Operation(summary = "Service to update ftp chip detail - deprecated since release-1.3.x.", description = "This endpoint has been deprecated since release-1.3.x.")
@ApiResponses({ @ApiResponse(code = 201, message = "When ftp chip detail successfully updated"),
@ApiResponse(code = 400, message = "When Request body passed is null or invalid"),
@ApiResponse(code = 500, message = "While updating ftp chip detail any error occured") })
Expand Down Expand Up @@ -236,17 +236,17 @@ public ResponseWrapper<FtpCertDownloadResponeDto> getPartnerCertificate(
}

/*
* This API has been deprecated since the release-1.3.0
* This endpoint has been deprecated since the release-1.3.x
* It has been replaced by the new GET /ftpchipdetail/search/v2 endpoint.
* The functionality provided by this API is now available in the new endpoint.
* Please use the new endpoint for all future requests.
*/
@Deprecated(since = "release-1.3.0")
@Deprecated(since = "release-1.3.x")
@ResponseFilter
@PostMapping("/search")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostftpchipdetailsearch())")
@Operation(summary = "Service to search ftp chip details - deprecated since 1.3.0 release.",
description = "This API has been deprecated since the 1.3.0 release and replaced by the GET /ftpchipdetail/search/v2 endpoint.")
@Operation(summary = "Service to search ftp chip details - deprecated since release-1.3.x.",
description = "This endpoint has been deprecated since the release-1.3.x and replaced by the GET /ftpchipdetail/search/v2 endpoint.")
public ResponseWrapper<PageResponseDto<FTPSearchResponseDto>> searchFtpChipDetails(
@RequestBody @Valid RequestWrapper<DeviceSearchDto> request) {
ResponseWrapper<PageResponseDto<FTPSearchResponseDto>> responseWrapper = new ResponseWrapper<>();
Expand All @@ -256,7 +256,8 @@ public ResponseWrapper<PageResponseDto<FTPSearchResponseDto>> searchFtpChipDetai

@PreAuthorize("hasAnyRole(@authorizedRoles.getPatchdeactivateftm())")
@PatchMapping(value = "/{ftmId}")
@Operation(summary = "Added in release-1.3.0, This endpoint deactivates FTM chip details based on the FTM chip details ID", description = "This endpoint deactivates FTM chip details based on the FTM chip details ID and the status provided in the request body. It checks if the FTM chip details belong to the logged-in user and ensures the status is \"approved\" with \"is_active\" set to true. If the conditions are not met, an error is thrown. This endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@Operation(summary = "This endpoint deactivates the FTM chip details based on the FTM chip details Id.",
description = "Avaiable since release-1.3.x. This endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
Expand All @@ -273,8 +274,8 @@ public ResponseWrapperV2<FtmDetailResponseDto> deactivateFtm(@PathVariable("ftmI

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetoriginalftmcertificate())")
@RequestMapping(value = "/{ftmId}/certificate-data", method = RequestMethod.GET)
@Operation(summary = "Added in release-1.3.0, This endpoint fetches both the CA signed certificate uploaded by the FTM Chip Provider and the MOSIP signed certificate generated by PMS",
description = "This endpoint fetches both the CA signed certificate uploaded by the FTM Chip Provider and the MOSIP signed certificate generated by PMS. It uses the Kernel Key Manager service endpoint getPartnerSignedCertificate/{$partnerCertId} to retrieve the certificates. The endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@Operation(summary = "This endpoint fetches both the CA signed certificate uploaded by the FTM Chip Provider and the MOSIP signed certificate generated by PMS",
description = "Avaiable since release-1.3.x. The endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema(hidden = true)))})
Expand All @@ -285,8 +286,8 @@ public ResponseWrapperV2<FtmCertificateDownloadResponseDto> getFtmCertificateDat

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetpartnersftmchipdetails())")
@GetMapping(value = "/search/v2")
@Operation(summary = "Added in release-1.3.0, available only for Partner Admin users, retrieves a list of all FTM chip details created by all partners",
description = "This endpoint, available for Partner Admin users only, retrieves the list of all FTM chip details created by all partners. It upgrades the earlier GET endpoint /ftpchipdetail/search by adding performance improvements and support for deactivated status. Additionally, it supports pagination, sorting, and filtering. This endpoint is configured for the role: PARTNER_ADMIN")
@Operation(summary = "This endpoint retrieves a list of all FTM Chip details created by all the FTM Providers.",
description = "Avaiable since release-1.3.x. This endpoint supports pagination, sorting, and filtering. It is configured for the role FTM_PROVIDER.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
Expand Down Expand Up @@ -334,8 +335,8 @@ ResponseWrapperV2<PageResponseV2Dto<FtmDetailSummaryDto>> getPartnersFtmChipDeta

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetftmchipdetails())")
@GetMapping
@Operation(summary = "Added in release-1.3.0, This endpoint fetches the list of all FTM Chip details associated with the partner IDs of the logged-in user",
description = "This endpoint fetches the list of all FTM Chip details associated with the partner IDs of the logged-in user. If no FTM Chip details are found, it returns an empty array with optional attributes like id, version, response time, and metadata. This endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@Operation(summary = "This endpoint retrieves a list of all FTM Chip details created by all the FTM Providers associated with the logged in user."
, description = "Available since release-1.3.x. This endpoint is configured for the roles FTM_PROVIDER or PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "OK"),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema(hidden = true)))})
Expand Down
Loading

0 comments on commit f8c6ff6

Please sign in to comment.