Consumption
1. NPM package
Prerequisite
Project should be using Node v20 or higher. Optional have TypeScript enabled.
NPM Installation
-
Install the package:
npm install @sap/csn-interop-specification -
Import the JSON schema and use it in code:
import { schemas } from "@sap/csn-interop-specification"; -
(Optional) When using TypeScript import and use the types:
import { CSNInteropRoot } from "@sap/csn-interop-specification";
2. Direct schema reference in a .json file via $ property
This enables json property name validation and code intellisense while editing CSN Interop files in an IDE.
{
"$schema": "https://sap.github.io/csn-interop-specification/spec-v1/csn-interop-effective.schema.json",
"csnInteropEffective": "1.0",
"$version": "2.0",
"definitions": {
"Airline": {
"kind": "entity",
"elements": {
"Name": {
"type": "cds.String",
}
}
}
}
}