cancel
Showing results for 
Search instead for 
Did you mean: 

Errror using GWSAMPLE_BASIC as an external service in CAP/CDS

Miram
Discoverer
0 Kudos

Today I was doing some testing with CDS, CAP and external API.

I created a test service and the test.js to connect to ES5 test system.

 

using {GWSAMPLE_BASIC as external} from './external/GWSAMPLE_BASIC';

service Test {
    entity BPSet : external.BusinessPartnerSet {}
    entity CSet : external.ContactSet {}
}

 

Miram_0-1713083339481.png

When I tried "BPSet" i got an error "'Address_City" not found. After some investigation I found out that there is somethin wrong with the metadata.

The metadata of my test-service look like:

Miram_1-1713083467177.png

When I use cds watch and check the metadata of gwsample-basic, there is difference in the address fields.

Miram_2-1713083521360.png

Miram_3-1713083583578.png

It seems, the complex type Address is replaced by Address_City, Address_Street. Anyone know why this happend and how I can resolve it to use the service?

BR

Miri

 

 

View Entire Topic
Dinu
Contributor

Why: CAP (nodejs) deprecated support for structure types in oData entities. It was possible to do this earlier with a x4 flavor.  The default flavor is to have flat structure for entities.  CAP flattens the entities using underscore as separator.  

How to proceed:  You cannot serve entities with properties of structure type.  But you can consume these. You have to write handlers to translate queries snd transform data just like any other transformation.