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

feat: add $schema property with default value to the top of the ORD document #43

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
1 change: 1 addition & 0 deletions lib/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const regexWithUnderScore = (name) => {
* @module defaults
*/
module.exports = {
$schema: "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json",
openResourceDiscovery: "1.9",
policyLevel: "none",
description: "this is an application description",
Expand Down
3 changes: 2 additions & 1 deletion lib/ord.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ module.exports = (csn) => {
throw error;
}

let oReturn = {openResourceDiscovery: "1.9",
let oReturn = { $schema: "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json",
openResourceDiscovery: "1.9",
policyLevel: fGetPolicyLevel(global),
description: fGetDescription(global),
products: fGetProducts(global),
Expand Down
2 changes: 1 addition & 1 deletion ord.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The below is the table for all the supported ORD Fields containing defaults and

Note: `namespace` is usually taken from `.cdsrc.json` if not we take the `package.json` name.


| ORD Field | Type | Defaults | Preset/Annotation | Usage Example | Description |
|----------|----------|----------|----------|----------|----------|
| $schema | string | ```"https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json"``` | Preset | ```"$schema": "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json"``` | Optional URL to the Open Resource Discovery document schema (defined as a JSON Schema). |
| openResourceDiscovery | string |- | - | - | 1.9 (generated by plugin) |
| policyLevel | string | ```"none"``` | Preset |```"policyLevel": "sap:core:v1"``` | The policy level (aka. compliance level) that this ORD Document or part of it needs to be compliant with. |
| description | string | ```"description": "this is an application description"``` | Preset | ```"description": "this is a custom description"``` | The description of the ORD Document itself. |
Expand Down