on 2022 Mar 17 7:04 AM
We are in need of using v2 version of Odata from CAP due to limitation in UI . I used @sap/cds-odata-v2-adapter-proxy to retrieve the v2 version.
I am able to fetch the data without any issue using /v2/entity but /v2/$metadata is not working. I get the below error.
Error: CDS compilation failed
Error: Structured OData is only supported with OData version v4
at handleMessages (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/base/messages.js:182:13)
at validate (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/api/validate.js:156:3)
at translateOptions (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/api/options.js:92:3)
at Object.edmx (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/api/options.js:189:25)
at edmx (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/api/main.js:526:45)
at Object.api [as edmx] (/home/user/cap_xsodata/node_modules/@sap/cds-compiler/lib/api/main.js:713:14)
at Object.edmx (/home/user/cap_xsodata/node_modules/@sap/cds/lib/compile/cdsc.js:112:48)
at Object.cds_compile_to_edmx [as edmx] (/home/user/cap_xsodata/node_modules/@sap/cds/lib/compile/to/edm.js:21:23)
at prepareMetadata (/home/user/cap_xsodata/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:688:39)
at getDefaultMetadata (/home/user/cap_xsodata/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:652:18)
OData definition is simple.
using DATA_MODEL_STOREINFO as _DATA_MODEL_STOREINFO from '../db/sales-data-model';
service SALES_SERVICES {
entity StoreInfo as projection on _DATA_MODEL_STOREINFO ;
}
@cds.persistence.exists
entity DATA_MODEL_STOREINFO {
key ID : String(20);
LOCATION : String(100);
key GROUP : String(100);
};
Can you please suggest how to fix this issue?
Request clarification before answering.
User | Count |
---|---|
68 | |
16 | |
12 | |
7 | |
7 | |
4 | |
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.