cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP odata.flavor=v4 Deprecated

Cristian
Participant
0 Kudos
121

Hi experts,

We were used to provide our services in SAP CAP with the cds configuration as follows in our package.json:

    "odata": {
      "flavor": "x4"
    },
This has been deprecated since 2023.
Without this, the names of the properties referring to another entity are flattened and built with the _ in the middle.
For example, for this entity:
entity SubaccountRpas : managed {
    key subaccountGUID : Association to one Subaccounts;
    key rpa: Association to one Rpas;
}
The get would response something like this:
        {
            "rpa_rpa": "RPA1",
            "subaccountGUID_subaccountGUID": SUABACCOUNTID"
        }
Is the only alternative now to rename these fields in the service definition to not be shown in this way? 
Thanks!
C.
 
View Entire Topic
david_kunz2
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Cristian ,

Indeed, it's better to not use the deprecated `x4` flavor.

For associations, you can still get the response in a structured format, e.g. by using `$expand=subaccountGUID` (and by omitting `omittingsubaccountGUID_subaccountGUID` in `$select`).

Best regards,
David

Cristian
Participant
0 Kudos
Many thanks David. Is there any way to rename the property at service layer for the flatten structure? Whilst defining the service, I cannot refer to property subaccountGUID_subaccountGUID as it is not recognized. Has anything to do that the name of the association is the same as the key in the target entity? Thanks!