Skip to Content
2
May 25 at 08:04 AM

Error cds build in action: A type, an element, or a service entity is expected here

127 Views Last edit May 25 at 08:22 AM 2 rev

Hi,

Since the Cds compile update to version @sap/cds-compiler: 2.1.4, cds build/all is not working propertly.

using { serv as my } from '../db/Test';


service api  @(requires:'authenticated-user'){
    entity Test as projection on my.Test;  
    action insertMultipleTest(value : array of my.Test) returns response;
}

define type response {
    response : String(12)
}

[ERROR] srv\test-services.cds:6:37-46: A type, an element, or a service entity is expected here (in action:“api.insertMultipleTest”/param:“value”)

I follow the instruction:

https://cap.cloud.sap/docs/cds/compiler-v2

Fix: Rewrite such references from Foo.a to Foo:a.

to replace with:

action insertMultipleTest(value : array of my:Test) returns response;

And I got the same error for node services and java services.

Thank you and kind regards