cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Metadata from oData response

SAPDEV1
Discoverer
0 Kudos

Hello,

I created an API that consumes an oData service created in SAP Gateway, and the response always looks like this :


I've read that in oData 2.0 the metadata isn't optional, but is there any way to hide this from the response ? Mostly because it contains a direct URL to our Backend, and I don't want the API consumers to have access to this data.

I tried looking up for the methods in DPC_EXT class but I couldn't find any.

Please help!

kvrsaicharan1152
Explorer
0 Kudos

How to remove metadata in json ? do you know

Accepted Solutions (0)

Answers (2)

Answers (2)

RalfHandl
Product and Topic Expert
Product and Topic Expert

The URLs in __metadata should be the URLs used by your API consumers to access the API, which they need to know anyway.

If your API is "hidden" behind a proxy and __metadata does not contain the "external" proxy URLs but instead shows the "internal" backend URLs, then the proxy isn't forwarding its external URL information to Gateway. See https://wiki.scn.sap.com/wiki/display/BSP/Using%20Proxies for information on how proxies and ABAP backends can be configured to produce correct "external" URLs.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

this is not possible.

You could use a reverse proxy and put it in between your backend system and the API consumers to shield the hostname of your system from the consumers.

BR

Andre