Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAP Plugin: cap-js ord plugin #1064

Merged
merged 14 commits into from
Jul 12, 2024
Binary file added plugins/assets/index/ordCLI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/assets/index/ordEndpoint.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,42 @@ Available for:

<div id="planned-plugins" />

## ORD (Open Resource Discovery)

Open Resource Discovery (ORD) is a protocol that allows applications and services to self-describe their exposed resources and capabilities.It can be used to describe static documentation, but can also reflect tenant specific configuration and extensions (at run-time).​
RoshniNaveenaS marked this conversation as resolved.
Show resolved Hide resolved
Typically, ORD is used to describe APIs and Events, but it also supports higher-level concepts like Entity Types (Business Objects) and Data Products (beta).
By adopting ORD, an application will implement a single-entry point (Service Provider Interface) that can be used to discover and crawl the relevant information / metadata. The information can be used to build a static metadata catalog or do detailed runtime inspection of actual system landscapes.
RoshniNaveenaS marked this conversation as resolved.
Show resolved Hide resolved

This plugin enables generation of ORD document for CAP based applications.
You can get the ORD document in multiple ways :

#### Programmatic API

```js
const cds = require('@sap/cds')
```

```js
const csn = await cds.load(cds.env.folders.srv)
const ord = cds.compile.to.ord(csn)
```

#### Command Line

```sh
cds compile <path to srv folder> --to ord [-o] [destinationFilePath]
```
<img width="1300" alt="Sample Application Demo" style="border-radius:0.5rem;" src="./assets/index/ordCLI.png">
renejeglinsky marked this conversation as resolved.
Show resolved Hide resolved

#### ORD Endpoints

1) Run `cds watch` in the application's root.
2) Check the following relative paths for ORD information - `/.well-known/open-resource-discovery` , `/open-resource-discovery/v1/documents/1`.
RoshniNaveenaS marked this conversation as resolved.
Show resolved Hide resolved

<img width="1300" alt="Sample Application Demo" style="border-radius:0.5rem;" src="./assets/index/ordEndpoint.gif">


renejeglinsky marked this conversation as resolved.
Show resolved Hide resolved