From 84934fa7e9fe83acaba4bf70a5a7fcde4fe0554b Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 23 Jul 2024 11:38:33 +0200 Subject: [PATCH] feat(impl): [#639] update documentation concerning ISO date support --- docs/src/api/irs-api.yaml | 13 ++++++----- .../controllers/PolicyStoreController.java | 22 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/src/api/irs-api.yaml b/docs/src/api/irs-api.yaml index 3624b9357..8d338c6a7 100644 --- a/docs/src/api/irs-api.yaml +++ b/docs/src/api/irs-api.yaml @@ -1047,13 +1047,14 @@ paths: ```\n \n### Filtering\n \n`search=,[EQUALS|STARTS_WITH|BEFORE_LOCAL_DATE|AFTER_LOCAL_DATE],`.\n\ \ \nExample: `search=BPN,STARTS_WITH,BPNL12&search=policyId,STARTS_WITH,policy2`.\n\ \ \n| Field | Supported Operations | Value Format\ - \ |\n|--------------|------------------------------------------|----------------------|\n\ + \ |\n|--------------|------------------------------------------|------------------------------------|\n\ | `BPN` | `EQUALS`, `STARTS_WITH` | any string \ - \ |\n| `policyId` | `EQUALS`, `STARTS_WITH` | any\ - \ string |\n| `action` | `EQUALS` \ - \ | `use` or `access` |\n| `createdOn` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE`\ - \ | `yyyy-MM-dd` |\n| `validUntil` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE`\ - \ | `yyyy-MM-dd` |\n\n### Sorting\n`sort=[BPN|policyId|action|createdOn|validUntil],[asc|desc]`.\n\ + \ |\n| `policyId` | `EQUALS`, `STARTS_WITH` \ + \ | any string |\n| `action` | `EQUALS`\ + \ | `use` or `access` |\n\ + | `createdOn` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE` | `yyyy-MM-dd` or\ + \ ISO date with time |\n| `validUntil` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE`\ + \ | `yyyy-MM-dd` or ISO date with time |\n\n### Sorting\n`sort=[BPN|policyId|action|createdOn|validUntil],[asc|desc]`.\n\ \ \nExample: `sort=BPN,asc&sort=policyId,desc`. _(default: `BPN,asc`)_\n\n\ ### Paging\n \nExample: `page=1&size=20` _(default page size: 10, maximal\ \ page size: 1000)_\n" 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..a62bc75fd 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 @@ -196,7 +196,8 @@ 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 +264,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 @@ -278,13 +279,13 @@ public List autocomplete( \s Example: `search=BPN,STARTS_WITH,BPNL12&search=policyId,STARTS_WITH,policy2`. \s - | Field | Supported Operations | Value Format | - |--------------|------------------------------------------|----------------------| - | `BPN` | `EQUALS`, `STARTS_WITH` | any string | - | `policyId` | `EQUALS`, `STARTS_WITH` | any string | - | `action` | `EQUALS` | `use` or `access` | - | `createdOn` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE` | `yyyy-MM-dd` | - | `validUntil` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE` | `yyyy-MM-dd` | + | Field | Supported Operations | Value Format | + |--------------|------------------------------------------|------------------------------------| + | `BPN` | `EQUALS`, `STARTS_WITH` | any string | + | `policyId` | `EQUALS`, `STARTS_WITH` | any string | + | `action` | `EQUALS` | `use` or `access` | + | `createdOn` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE` | `yyyy-MM-dd` or ISO date with time | + | `validUntil` | `BEFORE_LOCAL_DATE`, `AFTER_LOCAL_DATE` | `yyyy-MM-dd` or ISO date with time | ### Sorting `sort=[BPN|policyId|action|createdOn|validUntil],[asc|desc]`. @@ -326,7 +327,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) {