From 52ce75559a55bc31d5a820927810a67724d6c65c Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 23 Jul 2024 12:49:17 +0200 Subject: [PATCH] chore(documentation): [#639] deprecation note for `GET /irs/policies` (in future the paged endpoint should be used) --- docs/src/api/irs-api.yaml | 2 ++ .../controllers/PolicyStoreController.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/src/api/irs-api.yaml b/docs/src/api/irs-api.yaml index 3624b9357..c16fe89aa 100644 --- a/docs/src/api/irs-api.yaml +++ b/docs/src/api/irs-api.yaml @@ -794,6 +794,7 @@ paths: - Item Relationship Service /irs/policies: get: + deprecated: true description: Lists the registered policies that should be accepted in EDC negotiation. operationId: getAllowedPoliciesByBpn parameters: @@ -860,6 +861,7 @@ paths: security: - api_key: [] summary: Lists the registered policies that should be accepted in EDC negotiation. + (This method is DEPRECATED in favor of `/policies/paged`) tags: - Policy Store API post: diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java index beb077c6a..6fff19cb0 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java @@ -165,7 +165,8 @@ public CreatePoliciesResponse registerAllowedPolicy(@Valid @RequestBody final Cr } @Operation(operationId = "getAllowedPoliciesByBpn", - summary = "Lists the registered policies that should be accepted in EDC negotiation.", + summary = "Lists the registered policies that should be accepted in EDC negotiation. " + + "(This method is DEPRECATED in favor of `/policies/paged`)", deprecated = true, security = @SecurityRequirement(name = API_KEY), tags = { POLICY_API_TAG }, description = "Lists the registered policies that should be accepted in EDC negotiation.") @ApiResponses(value = { @ApiResponse(responseCode = "200", @@ -192,11 +193,13 @@ public CreatePoliciesResponse registerAllowedPolicy(@Valid @RequestBody final Cr @GetMapping("/policies") @ResponseStatus(HttpStatus.OK) @PreAuthorize("hasAuthority('" + IrsRoles.ADMIN_IRS + "')") + @Deprecated(forRemoval = true) public Map> getPolicies(// @RequestParam(required = false) // @ValidListOfBusinessPartnerNumbers(allowDefault = true) // @Parameter(description = "List of business partner numbers. " - + "This may also contain the value \"default\" in order to query the default policies.") // + + "This may also contain the value \"default\" in order to query the default policies.") + // final List businessPartnerNumbers // ) { @@ -263,7 +266,7 @@ public List autocomplete( @GetMapping("/policies/paged") @ResponseStatus(HttpStatus.OK) @Operation(summary = "Find registered policies that should be accepted in EDC negotiation " - + "(with filtering, sorting and paging).", // + + "(with filtering, sorting and paging).", // description = """ Fetch a page of policies with options to filter and sort. \s @@ -326,7 +329,8 @@ public Page getPoliciesPaged(// @RequestParam(required = false) // @ValidListOfBusinessPartnerNumbers(allowDefault = true) // @Parameter(name = "businessPartnerNumbers", description = "List of business partner numbers. " - + "This may also contain the value \"default\" in order to query the default policies.") // + + "This may also contain the value \"default\" in order to query the default policies.") + // final List businessPartnerNumbers) { if (pageable.getPageSize() > MAX_PAGE_SIZE) {