Generated oData v2 VDM: DeSerializing of requests with sub-sub-selects not working as expected
See original GitHub issueDescribe the bug I am using a generated Virtual Data Model to call an onPremise system oData v2 API and to fetch Customer data. It’s all working and I am able to interact and establish a connection. As soon as I am adding .select() statements, having sub-sub-selects, the data is coming from ERP (like expected) but the deSerializing isn’t working anymore. The sub-sub-select entity and its properties are coming up as customFields instead.
To Reproduce The following call is showing the sub-sub-select statement:
const haystack2 = await customerSetApi.requestBuilder().getAll()
.top(1)
.select(customerSetApi.schema.ALL_FIELDS,
customerSetApi.schema.TO_CUSTOMER_CONTACT.select(customerContactSetApi.schema.ALL_FIELDS),
customerSetApi.schema.TO_CUSTOMER_SALES.select(customerSalesSetApi.schema.ALL_FIELDS),
customerSetApi.schema.TO_CUSTOMER_SALES.select(customerSalesSetApi.schema.TO_CUSTOMER_SALES_PARTNER.select(customerSalesPartnerSetApi.schema.ALL_FIELDS)),
customerSetApi.schema.TO_CUSTOMER_SALES.select(customerSalesSetApi.schema.TO_CUSTOMER_SALES_MULTI_LANGUAGE.select(customerSalesMultiLanguageSetApi.schema.ALL_FIELDS)))
.execute({ destinationName: config.get('DESTINATIONS.CLOUDCONNECTOR'), useCache: true })
console.log('Using default deSerializer this should be feasible as well: ')
console.log(haystack2[0].toCustomerSales[0].toCustomerSalesPartner[0]);
Expected behavior I do expect the deSerializing of the oData v2 response will be provided for sub-sub-selects in the same way it’s done for selects and sub-selects. The data of “TO_CUSTOMER_CONTACT” and also for “TO_CUSTOMER_SALES” is getting deSerialized like expected, it’s just the sub-sub-selects who are missing and do appear as customFields 😦
Screenshots
The first screenshot shows that the data is available and the request is working. Not deSerialized, it’s all fine and the json contains all selected data, within sub-sub-selects:
The deSerialized approach shows you the sub-sub-selected data isn’t going to be deSerialized like expected, but added as customFields instead:
Used Versions:
- node version 14.17.6
- npm version 8.1.1
- SAP Cloud SDK version: “@sap-cloud-sdk/generator”: “^2.5.0”
Impact / Priority
This is blocking default capabilities and within our planed migration to SAP Cloud SDK v2. Timeline of project: Go Live end of july.
Do not hesitate to ask more details or schedule a short session to get a deep-dive about it. Thanks and Kind regards, Cedric
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Hey @jjtang1985 , thx for the feedback. I checked immediately and yes, you’re right. It’s working this way. So the reason is about the new instances only?
Maybe it’s worth it writing some lines on your documentation page 😉
I mean … as I already shared with you, I am updating from SAP Cloud SDK v1 to v2 and I guess I am just one of the first who is doing this so maybe it’s worth it saving time, energy and frustration from others by updating this information hehe
Thanks again! Good job!
Hi @drvup,
Thank you very much for your feedback. Sure, we’ll update our documentation page;)
Best regards, Junjie