-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomposition.schema.json
208 lines (208 loc) · 6.41 KB
/
composition.schema.json
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"$defs": {
"Location": {
"description": "The location of a file or directory.\n\nA location supports referencing the file or directory using:\n\n- relative path\n- absolute path\n- git URL\n- git URL plus revision/tag/branch plus path in the repo\n\nWhen `url` is specified, the `path` is relative to the root of the repository.\n\nAt least one of `path` or `url` must be specified.",
"properties": {
"path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The relative or absolute path to the location.",
"title": "Path"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Git URL to the location.",
"title": "Url"
}
},
"title": "Location",
"type": "object"
},
"Overlay": {
"description": "An object describing how to overlay a pattern in a composition.",
"properties": {
"pattern_location": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/Location"
}
],
"description": "The location of the pattern file for this overlay.",
"title": "Pattern Location"
},
"ask_questions": {
"default": true,
"description": "Ask the user this pattern's questions? When false, the defaults are used.",
"title": "Ask Questions",
"type": "boolean"
},
"defaults": {
"description": "Override one or more question's default values in this pattern. Values can be a template string.",
"title": "Defaults",
"type": "object"
},
"extra_context": {
"description": "Override one or more keys in this pattern's `extra_context`. Values can be a template string.",
"title": "Extra Context",
"type": "object"
},
"answer_map": {
"description": "This signifies that a previous overlay has already answered one or more of this pattern's questions. The key is this pattern's question name and the value is a template string that references or modifies a previous pattern's question name.",
"title": "Answer Map",
"type": "object"
},
"overwrite_files": {
"description": "A list of paths or glob patterns of files that may be overwritten. An empty list means do not overwrite any files.",
"items": {
"type": "string"
},
"title": "Overwrite Files",
"type": "array"
},
"exclude_files": {
"description": "A list of paths or glob patterns of files to exclude from the generation (overrides the pattern's configuration)",
"items": {
"type": "string"
},
"title": "Exclude Files",
"type": "array"
}
},
"required": [
"pattern_location"
],
"title": "Overlay",
"type": "object"
},
"Task": {
"description": "A task to run while rendering a composition.",
"properties": {
"command": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"description": "The command to run.",
"title": "Command"
},
"use_shell": {
"default": false,
"description": "Whether to run the command in a shell.\n\nIf `command` is a str, this is always `True`.",
"title": "Use Shell",
"type": "boolean"
},
"env": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Environment variables to set when running the command.\n\nEach environment variable value may be a template string rendered using the context so far.",
"title": "Env"
},
"when": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A template string that will render as `True` if the task should run.",
"title": "When"
},
"context_variable_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of a context variable that will be set to the command's stdout. If not provided, the the output is not saved to the context.",
"title": "Context Variable Name"
}
},
"required": [
"command"
],
"title": "Task",
"type": "object"
}
},
"description": "The settings for a composition.",
"properties": {
"steps": {
"description": "A list of pattern overlays and tasks to compose.",
"items": {
"anyOf": [
{
"$ref": "#/$defs/Overlay"
},
{
"$ref": "#/$defs/Task"
}
]
},
"title": "Steps",
"type": "array"
},
"merge_keys": {
"additionalProperties": {
"enum": [
"overwrite",
"comprehensive"
],
"type": "string"
},
"description": "Merge the values of one or more keys in a specific way. This is useful for `yaml` or `json` values. Valid merge methods are `overwrite`, `nested-overwrite`, and `comprehensive`.",
"title": "Merge Keys",
"type": "object"
},
"extra_context": {
"description": "Override one or more keys in this pattern's `extra_context`. Values can be a template string.",
"title": "Extra Context",
"type": "object"
}
},
"title": "Composition",
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/callowayproject/project-forge/modelmetaclass.schema.json"
}