Repository navigation
Expand file tree
/
Copy pathlearn-list.schema.json
More file actions
75 lines (75 loc) · 4.61 KB
/
Copy pathlearn-list.schema.json
File metadata and controls
75 lines (75 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "coding-study learn list document",
"description": "`cstudy learn --json`: the guides and the learning paths, and what the learner profile hid. Spec: docs/specs/cli.md#cstudy-learn",
"type": "object",
"additionalProperties": false,
"required": ["guides", "paths", "profile"],
"properties": {
"guides": { "type": "array", "items": { "$ref": "#/$defs/guide" } },
"paths": { "type": "array", "items": { "$ref": "#/$defs/path" } },
"profile": { "$ref": "#/$defs/profile" }
},
"$defs": {
"count": { "type": "integer", "minimum": 0 },
"slug": { "type": "string", "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
"label": { "type": "string", "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
"instant": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$" },
"level": { "enum": ["intro", "core", "advanced"] },
"profile": {
"description": "The learner profile's part in this listing. Spec: docs/specs/cli.md#explicit-filters-and-widening",
"type": "object",
"additionalProperties": false,
"required": ["languages", "job_roles", "domains", "hidden"],
"properties": {
"languages": { "description": "Always null: a guide teaches in every language", "type": "null" },
"job_roles": { "description": "The profile's roles that narrowed the lists, never `general`; null when they narrowed nothing (every role, `--role` or `--widen` replaced them)", "anyOf": [{ "type": "array", "items": { "$ref": "#/$defs/label" } }, { "type": "null" }] },
"domains": { "description": "The profile's domains that narrowed the lists; null when they narrowed nothing", "anyOf": [{ "type": "array", "items": { "$ref": "#/$defs/label" } }, { "type": "null" }] },
"hidden": {
"description": "What the profile hid: the guides and paths `--widen all` would add with the same other flags, each 0 when it hid none",
"type": "object",
"additionalProperties": false,
"required": ["guides", "paths"],
"properties": {
"guides": { "$ref": "#/$defs/count" },
"paths": { "$ref": "#/$defs/count" }
}
}
}
},
"guide": {
"type": "object",
"additionalProperties": false,
"required": ["id", "slug", "title", "summary", "level", "domains", "job_roles", "prerequisites", "related", "problems", "read", "read_at"],
"properties": {
"id": { "description": "The canonical ID, `guide/<slug>`", "type": "string", "pattern": "^guide/[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
"slug": { "$ref": "#/$defs/slug" },
"title": { "type": "string", "minLength": 1 },
"summary": { "type": "string" },
"level": { "$ref": "#/$defs/level" },
"domains": { "description": "What the guide is about", "type": "array", "items": { "$ref": "#/$defs/label" } },
"job_roles": { "description": "Who the guide is for, `general` for any engineer", "type": "array", "items": { "$ref": "#/$defs/label" } },
"prerequisites": { "description": "The slugs of the guides to read first", "type": "array", "items": { "$ref": "#/$defs/slug" } },
"related": { "description": "The slugs of related guides", "type": "array", "items": { "$ref": "#/$defs/slug" } },
"problems": { "description": "The slugs of the problems that practice it", "type": "array", "items": { "$ref": "#/$defs/slug" } },
"read": { "description": "Whether you marked it read", "type": "boolean" },
"read_at": { "description": "When you marked it read, or null", "anyOf": [{ "$ref": "#/$defs/instant" }, { "type": "null" }] }
}
},
"path": {
"type": "object",
"additionalProperties": false,
"required": ["id", "slug", "title", "summary", "level", "guides", "done", "total"],
"properties": {
"id": { "description": "The canonical ID, `path/<slug>`", "type": "string", "pattern": "^path/[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
"slug": { "$ref": "#/$defs/slug" },
"title": { "type": "string", "minLength": 1 },
"summary": { "type": "string" },
"level": { "description": "The level the path is for; null when it names none and has no guides", "anyOf": [{ "$ref": "#/$defs/level" }, { "type": "null" }] },
"guides": { "description": "The slugs of its guide steps, in order", "type": "array", "items": { "$ref": "#/$defs/slug" } },
"done": { "description": "The steps done", "$ref": "#/$defs/count" },
"total": { "description": "The steps", "$ref": "#/$defs/count" }
}
}
}
}