Skip to Content
Jan 21, 2021 at 09:27 AM

CAP service - OData v2 response different content-type for different views


Hi all,

I have a CAP Project that consuming SAP HANA Service OData service V2

        "dataSources": {
            "storeService": {
                "uri": "/v2/StoreMasterData",
                "type": "OData",
                "settings": {
                    "odataVersion": "2.0"

Different views are defined in the context, and they work fine with GET in OData v4.

But some views (not all are affected by this issue!), created in the same way of the others, are not working with GET in OData v2.

If I check the Header Response I see that the content-type is different, and I'm not able to understand way.

Here one example:

Response Header / content-type is always application/json;odata.metada=minimal

Instead, if the same view is called by GET in OData v2, I receive the Internal Server Error, and the Response Header / content-type is text/html; charset=utf-8

Does somebody have any idea about what is wrong?