cap-js / ord

Open Resource Discovery (ORD) is a protocol that allows applications and services to self-describe their exposed resources and capabilities. This plugin enables generation of ORD document for CAP based applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ord generated document contains undefined in different ids

zongqichen opened this issue · comments

The ord plugin version is 1.0.3. The following example is ord plugin generated, you can find the full document

  "apiResources": [
    {
      "ordId": "sap.sm:apiResource:undefined.SupplierService:v1",
...
      "partOfGroups": [
        "sap.cds:service:sap.sm:undefined.SupplierService"
      ],
...
    {
      "ordId": "sap.sm:apiResource:undefined.MaterialService:v1",
 ...
    {
      "ordId": "sap.sm:apiResource:undefined.PurchaseOrderService:v1",
...
      "partOfGroups": [
        "sap.cds:service:sap.sm:undefined.PurchaseOrderService"
      ],

I would expect, for example, the full original document

  "apiResources": [
    {
      "ordId": "sap.s4:apiResource:SupplierService:v1",

If it is a bug, I can fix it.

The root cause is missing error handling, for example templates.js#L63. If the entity doesn't have annotation @ODM.entityName, it will return undefined. I assume all similar undefined appearance will be same.