A collection of schema. Currently, no specific grouping.
Add any examples to the example directory.
Schema are to the schema directory. The following schema are allowed:
-
jsdoc
-
json-schema
-
json-ld
-
typescript
-
webidl
-
[https://json-ld.org/](Official JSON LD site)
-
[https://en.wikipedia.org/wiki/JSON-LD](JSON LD Wikipedia)
Install:
npm install @theopenweb/schema
If using Node.js and want perform builds, any utility functions are provided in the main index.js file.
/**
* @type {import('schema/jsdoc').Size}
*/
// First convert to typescript
// CLI
// https://github.com/bcherny/json-schema-to-typescript#cli
// json2ts ./node_modules/schema/json-schema/index.json > schema.d.ts
/**
* @type {import('schema.d.ts').definitions.Work}
*/
{
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"MyType": {
"$ref": "language-scripts.json#definitions/scripts"
}
}
}
https://www.w3.org/TR/json-ld/#typed-values
https://www.w3.org/TR/json-ld/#string-internationalization
tsc [SOURCE] --declaration --emitDeclarationOnly --allowJs
- Schema MAY be generated into ./schema/generated.
- Schema MAY be generated either via an arbitrary build process, or via conversion.
- For conversions, use the following file hierarchy: "./schema/generated/[DESTINATION_SCHEMA_TYPE]/from_[SOURCE_SCHEMA_TYPE]/[FILENAME]"
- For arbitrary build, use the following file hierarchy: "./schema/generated/[DESTINATION_SCHEMA_TYPE]/[FILENAME]"