0

We are currently struggling with providing an OData service for an entity, which has as part of its key a property of type DateTime. This key property is not part of the key map in the OData request given by the SAP Cloud Provisioning SDK. This seems to be due to a bug in the parsing of the request in the method com.sap.cloud.sdk.service.prov.v2.data.provider.CXSDataProvider.getKeys(List):

if (type.toString().equals("Edm.Date")) {
  Date value = type.valueOfString(keyPredicate.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), Date.class);
  keys.put(property.getName(), value);
}

Since there is no Edm.Date type in the OData standard, my guess is that instead the following would have been correct:

if (type.toString().startsWith("Edm.Date")) {
  [s. above]
}

Is this correct or are we doing something wrong here? In addition there is a TODO marker on the method itself pointing out that only a subset of EDM types is currently supported as a key. Are there any plans to fix this TODO?

Tim L.
  • 224
  • 2
  • 11

1 Answers1

2

As muchumanoj commented, the issue should be resolved in version 1.29.5 of <groupId>com.sap.cloud.servicesdk.prov</groupId><artifactId>odatav2-prov</artifactId>. Thanks for reporting it.

Florian Wilhelm
  • 600
  • 4
  • 17
  • Thanks Florian, we will check this. However, we noticed that in 1.32.0 which is the version for the newly required Cloud SDK 2.21.0 this fix is not part. Is it planned to include that in the next release? – Tim L. Oct 09 '19 at 09:59
  • Please notice, these are the latest four releases: `1.34.1`, `1.29.5`, `1.33.0`, `1.32.5`. As you can see `1.29.5` has been released after `1.32.0`, despite the number. – Alexander Dümont Oct 11 '19 at 16:10