2024 Sep 26 12:57 PM - edited 2024 Sep 26 12:57 PM
Dear all,
while consuming a OData-Service build with RAP from a S4 System i noticed that CAP / @ash_G-cloud-sdk/http-client generates malformed requests.
I tracked the source of my issue. The RAP metadata contains:
<ComplexType Name="EntityControl">
<Property Name="Deletable" Type="Edm.Boolean" Nullable="false" />
<Property Name="Updatable" Type="Edm.Boolean" Nullable="false" />
</ComplexType>
Imported via `cds import` the following will be generated:
@CDS.external : true
type v0001.EntityControl {
Deletable : Boolean not null;
Updatable : Boolean not null;
};
The generated request will look like this from CAP to RAP and leads to an error:
/ENTITYSET?$select=TYPE_Deletable,TYPE_Updatable
The correct request working with the RAP based service would be:
/ENTITYSET?$select=TYPE/Deletable,TYPE/Updatable
By looking into how CAP based services generate their metdata, i found out that types are not converted to "ComplexTypes" in odata but rather into simple fields with the name of the compley type prepanded and connected to the field name via `_`.
Exmaple Response from RAP:
{
ID: 1,
TYPE : {
Deletable: true,
Updateable: true
}
}
Response from CAP:
{
ID: 1,
TYPE_Deletable: true,
TYPE_Updateable: true
}
How can i import a *.edmx from a RAP service into CAP so that CAP generates valid requests for entities containing complex types?
Thank you very much and best regards,
Tobias
Request clarification before answering.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.