cancel
Showing results for 
Search instead for 
Did you mean: 

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

carmenpalmisano
Explorer
0 Kudos
1,148

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?

Regards,

Carmen.

View Entire Topic
gregorw
Active Contributor
0 Kudos

Is this an entity with analytic capabilities? If there is no key defined in the entity it will work in V4 but throw an error in V2. Please check the logs that you see when the V2 request is done.