generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Description
Property: cds.model from doc-github states the following code fragment is what is used in server.js for assigning the property cds.model.
cds.model = await cds.load('*')
With the recent updates, observed in v 9.7, this cannot be the case; cds.load returns csn which does not have a property entities. So, this assignment will not be compatible with the definition of the property cds.entities; it would be undefined after this assignment. At the minimum, for type compatibility, this has to be
cds.model = await cds.load('*').then(cds.compile.for.nodejs)
Log in cds.repl with samples project
Welcome to cds repl v 9.7.1
> cds.model = await cds.load("*")
> typeof(cds.entities)
undefined
> cds.model = await cds.load("*").then(cds.compile.for.nodejs)
> typeof(cds.entities)
function
> cds.entities("sap.capire.bookshop").Books.kind
entity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels