Skip to content

Commit

Permalink
fix: include json schema in distributed package
Browse files Browse the repository at this point in the history
  • Loading branch information
bigman73 committed Nov 19, 2022
1 parent 853262d commit 6f1eaae
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 2 deletions.
100 changes: 100 additions & 0 deletions lib/src/jgfSchemaV2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://jsongraphformat.info/v2.0/json-graph-schema.json",
"title": "JSON Graph Schema",
"oneOf": [
{
"type": "object",
"properties": {
"graph": {
"$ref": "#/definitions/graph"
}
},
"additionalProperties": false,
"required": ["graph"]
},
{
"type": "object",
"properties": {
"graphs": {
"type": "array",
"items": {
"$ref": "#/definitions/graph"
}
}
},
"additionalProperties": false
}
],
"definitions": {
"graph": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"directed": {
"type": ["boolean"],
"default": true
},
"type": {
"type": "string"
},
"metadata": {
"type": ["object"]
},
"nodes": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"metadata": {
"type": "object"
}
},
"additionalProperties": false
}
},
"edges": {
"type": ["array"],
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"source": {
"type": "string"
},
"target": {
"type": "string"
},
"relation": {
"type": "string"
},
"directed": {
"type": ["boolean"],
"default": true
},
"label": {
"type": "string"
},
"metadata": {
"type": ["object"]
}
},
"required": ["source", "target"]
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "resolveJsonModule": true, /* Enable importing .json files. */
"resolveJsonModule": true /* Enable importing .json files. */,
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

/* JavaScript Support */
Expand Down Expand Up @@ -100,5 +100,5 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src", "index.ts"]
"include": ["src", "index.ts", "src/jgfSchemaV2.json"]
}

0 comments on commit 6f1eaae

Please sign in to comment.