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.
Apache License 2.0
3 stars 4 forks source link

Fix: openResourceDiscovery will be not updated #84

Closed zongqichen closed 3 weeks ago

zongqichen commented 3 weeks ago

There is a function missing which update top level property, for instance openResourceDiscovery. The code as following:

    let ordDocument = {
        $schema: "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json",
        openResourceDiscovery: "1.9",
        policyLevel: _getPolicyLevel(appConfig),
        description: _getDescription(appConfig),
        products: _getProducts(appConfig),
        groups: _getGroups(linkedCsn, appConfig),
    };

will always use the default value 1.9. There are two solutions:

  1. Only fix openResourceDiscovery by adding similar function like _getOpenResourceDiscovery
  2. Or combine them into new function, e.g _getTopLevelProperty