cloud-sdk-java icon indicating copy to clipboard operation
cloud-sdk-java copied to clipboard

`ODataRequestRead` with https://<tenant_url>/api/v1/dwc/consumption/relational/<space_id>/<asset_id>/$metadata results in 406

Open KarlHakanNordgren opened this issue 1 year ago • 2 comments

The documentation here says that hitting

https://<tenant_url>/api/v1/dwc/consumption/relational/<space_id>/<asset_id>/$metadata

will retrieve metadata but the following results in a 406 response.

ODataRequestRead( "/api/v1/dwc/consumption/relational/('$spaceId')/('$assetId')/$metadata" . ODataResourcePath.of(""), . "", ODataProtocol.V4 ).execute(httpClient)`

KarlHakanNordgren avatar May 21 '24 14:05 KarlHakanNordgren

The reason is that the JSON looks like this

{ "@odata.context": "XX", "name": "XX", "label": "XX", "spaceName": "XX", "assetRelationalMetadataUrl": null, "assetRelationalDataUrl": null, "assetAnalyticalMetadataUrl": "XX", "assetAnalyticalDataUrl": "XX", "supportsAnalyticalQueries": true, "hasParameters": false }

But the code to parse the JSON here requires it to have a value node.

KarlHakanNordgren avatar May 22 '24 08:05 KarlHakanNordgren

May I ask, what do you expect from calling GET to an OData entity /$metadata endpoint? Compared to a regularly calling GET to the entity?

SAP Cloud SDK is not designed to interpret $metadata payload. If you insist on calling the endpoint, please consume the HttpResponse manually yourself.

newtork avatar May 22 '24 08:05 newtork