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

Feat: lastUpdate is missing #85

Closed zongqichen closed 2 days ago

zongqichen commented 1 week ago

The current implementation doesn't contain lastUpdate filed, which is important to UCL (Unified Customer Landscape). UCL has a function to decide whether update the ord document backend by version and lastUpdate fileds.

Fannon commented 1 week ago

Good catch!

First idea: We could just create a new Date() on startup of the CAP server. Then as long as the server runs, it will not change and UCL will not fetch metadata again. This works fine as long as the metadata is static - as it cannot change while the server is running. This may be sufficient as a "default". Not sure if we have access to the date when the codebase was last updated (that would be ideal, but I would be surprised if the CAP app itself knows this).

If you want lastUpdated to not update everytime you restart the server ,you have to manually set it via @ORD.Extensions. (this should already work).

Once we have run-time tenant specific ORD metadata, the lastUpdate situation gets more complicated because it needs to be updated everytime the resource has been changed at run-time. But for now this is not supported and we should first improve the static metadata case.