Add JSON Schema for documentation and metadata

pull/1289/head
Simon Legner 4 years ago
parent c334c5fd57
commit 25a93fc1ab

@ -95,6 +95,8 @@ The end result is a set of normalized HTML partials and two JSON files (index +
More information about [scrapers](./docs/scraper-reference.md) and [filters](./docs/filter-reference.md) is available in the `docs` folder.
The [JSON Schema](https://json-schema.org/) for a documentation and its metadata is provided in https://github.com/freeCodeCamp/devdocs/tree/master/public/schema.
## Available Commands
The command-line interface uses [Thor](http://whatisthor.com). To see all commands and options, run `thor list` from the project's root.

@ -0,0 +1,54 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Documentation",
"definitions": {
"Documentation": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/definitions/Entry"
}
},
"types": {
"type": "array",
"items": {
"$ref": "#/definitions/Type"
}
}
},
"required": ["entries", "types"]
},
"Entry": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": ["name", "path", "type"]
},
"Type": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"count": {
"type": "integer"
},
"slug": {
"type": "string"
}
},
"required": ["count", "name", "slug"]
}
}
}

@ -0,0 +1,50 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Doc",
"definitions": {
"Doc": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"type": {
"type": "string"
},
"links": {
"$ref": "#/definitions/Links"
},
"version": {
"type": "string"
},
"release": {
"type": "string"
},
"mtime": {
"type": "integer"
},
"db_size": {
"type": "integer"
}
},
"required": ["db_size", "mtime", "name", "release", "slug", "type"]
},
"Links": {
"type": "object",
"properties": {
"home": {
"type": "string",
"format": "uri"
},
"code": {
"type": "string",
"format": "uri"
}
},
"required": ["code", "home"]
}
}
}
Loading…
Cancel
Save