@@ -40,8 +40,22 @@ Detailed helptext is always available interactively via
40
40
the error and exit. Use ``--traceback-mode full `` to request the full traceback
41
41
be printed, for debugging and troubleshooting.
42
42
43
- Other Schema Options
44
- --------------------
43
+ Environment Variables
44
+ ---------------------
45
+
46
+ The following environment variables are supported.
47
+
48
+ .. list-table :: Environment Variables
49
+ :widths: 15 30
50
+ :header-rows: 1
51
+
52
+ * - Name
53
+ - Description
54
+ * - ``NO_COLOR ``
55
+ - Set ``NO_COLOR=1 `` to explicitly turn off colorized output.
56
+
57
+ Schema Selection Options
58
+ ------------------------
45
59
46
60
No matter what usage form is used, a schema must be specified.
47
61
@@ -113,68 +127,6 @@ The following options control caching behaviors.
113
127
- The name to use for caching a remote schema.
114
128
Defaults to using the last slash-delimited part of the URI.
115
129
116
- Environment Variables
117
- ---------------------
118
-
119
- The following environment variables are supported.
120
-
121
- .. list-table :: Environment Variables
122
- :widths: 15 30
123
- :header-rows: 1
124
-
125
- * - Name
126
- - Description
127
- * - ``NO_COLOR ``
128
- - Set ``NO_COLOR=1 `` to explicitly turn off colorized output.
129
-
130
- Parsing Options
131
- ---------------
132
-
133
- ``--default-filetype ``
134
- ~~~~~~~~~~~~~~~~~~~~~~
135
-
136
- The default filetype to assume on instance files when they are detected neither
137
- as JSON nor as YAML.
138
-
139
- For example, pass ``--default-filetype yaml `` to instruct that files which have
140
- no extension should be treated as YAML.
141
-
142
- By default, this is not set and files without a detected type of JSON or YAML
143
- will fail.
144
-
145
- ``--data-transform ``
146
- ~~~~~~~~~~~~~~~~~~~~
147
-
148
- ``--data-transform `` applies a transformation to instancefiles before they are
149
- checked. The following transforms are supported:
150
-
151
- - ``azure-pipelines ``:
152
- "Unpack" compile-time expressions for Azure Pipelines files, skipping them
153
- for the purposes of validation. This transformation is based on Microsoft's
154
- lanaguage-server for VSCode and how it handles expressions
155
-
156
- - ``gitlab-ci ``:
157
- Handle ``!reference `` tags in YAML data for gitlab-ci files. This transform
158
- has no effect if the data is not being loaded from YAML, and it does not
159
- interpret ``!reference `` usages -- it only expands them to lists of strings
160
- to pass schema validation
161
-
162
- ``--fill-defaults ``
163
- -------------------
164
-
165
- JSON Schema specifies the ``"default" `` keyword as potentially meaningful for
166
- consumers of schemas, but not for validators. Therefore, the default behavior
167
- for ``check-jsonschema `` is to ignore ``"default" ``.
168
-
169
- ``--fill-defaults `` changes this behavior, filling in ``"default" `` values
170
- whenever they are encountered prior to validation.
171
-
172
- .. warning ::
173
-
174
- There are many schemas which make the meaning of ``"default" `` unclear.
175
- In particular, the behavior of ``check-jsonschema `` is undefined when multiple
176
- defaults are specified via ``anyOf ``, ``oneOf ``, or other forms of polymorphism.
177
-
178
130
"format" Validation Options
179
131
---------------------------
180
132
@@ -253,3 +205,61 @@ follows:
253
205
always passes. Otherwise, check validity in the python engine.
254
206
* - python
255
207
- Require the regex to be valid in python regex syntax.
208
+
209
+ Other Options
210
+ --------------
211
+
212
+ ``--default-filetype ``
213
+ ~~~~~~~~~~~~~~~~~~~~~~
214
+
215
+ The default filetype to assume on instance files when they are detected neither
216
+ as JSON nor as YAML.
217
+
218
+ For example, pass ``--default-filetype yaml `` to instruct that files which have
219
+ no extension should be treated as YAML.
220
+
221
+ By default, this is not set and files without a detected type of JSON or YAML
222
+ will fail.
223
+
224
+ ``--data-transform ``
225
+ ~~~~~~~~~~~~~~~~~~~~
226
+
227
+ ``--data-transform `` applies a transformation to instancefiles before they are
228
+ checked. The following transforms are supported:
229
+
230
+ - ``azure-pipelines ``:
231
+ "Unpack" compile-time expressions for Azure Pipelines files, skipping them
232
+ for the purposes of validation. This transformation is based on Microsoft's
233
+ lanaguage-server for VSCode and how it handles expressions
234
+
235
+ - ``gitlab-ci ``:
236
+ Handle ``!reference `` tags in YAML data for gitlab-ci files. This transform
237
+ has no effect if the data is not being loaded from YAML, and it does not
238
+ interpret ``!reference `` usages -- it only expands them to lists of strings
239
+ to pass schema validation
240
+
241
+ ``--fill-defaults ``
242
+ ~~~~~~~~~~~~~~~~~~~
243
+
244
+ JSON Schema specifies the ``"default" `` keyword as potentially meaningful for
245
+ consumers of schemas, but not for validators. Therefore, the default behavior
246
+ for ``check-jsonschema `` is to ignore ``"default" ``.
247
+
248
+ ``--fill-defaults `` changes this behavior, filling in ``"default" `` values
249
+ whenever they are encountered prior to validation.
250
+
251
+ .. warning ::
252
+
253
+ There are many schemas which make the meaning of ``"default" `` unclear.
254
+ In particular, the behavior of ``check-jsonschema `` is undefined when multiple
255
+ defaults are specified via ``anyOf ``, ``oneOf ``, or other forms of polymorphism.
256
+
257
+ ``--base-uri ``
258
+ ~~~~~~~~~~~~~~
259
+
260
+ ``check-jsonschema `` defaults to using the ``"$id" `` of the schema as the base
261
+ URI for ``$ref `` resolution, falling back to the retrieval URI if ``"$id" `` is
262
+ not set.
263
+
264
+ ``--base-uri `` overrides this behavior, setting a custom base URI for ``$ref ``
265
+ resolution.
0 commit comments