Skip to content

Commit e3b815f

Browse files
committed
docs: Fix config schema
It seems like jsonschema2md ironically doesn't validate the schema of the input it receives. :) It fails horribly with: ``` file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:697 ...schema[keyword`examples`].map((example) => paragraph(code('yaml', yaml.dump(example, undefined, 2)))), ^ TypeError: schema[keyword].map is not a function or its return value is not iterable at makeexamples (file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:697:38) at file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:762:14 at Array.map (<anonymous>) at makeproplist (file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:750:54) at file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:831:16 at Array.map (<anonymous>) at makedefinitions (file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:818:10) at file:///home/cklein/elastisys/welkin/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:888:10 at /home/cklein/elastisys/welkin/node_modules/ferrum/src/sequence.js:1234:12 at /home/cklein/elastisys/welkin/node_modules/ferrum/src/sequence.js:807:5 ``` I added `console.log(schema[keyword`examples`]);` before the failing line and, long story short, it seems like jsonschema2md expects a list of examples and not a string.
1 parent 1bc3731 commit e3b815f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/schemas/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4283,7 +4283,8 @@ properties:
42834283
description: Configure a pattern of node groups to exclude from the resource request alerts. This can be used to exclude certain node groups from request alerts, while still getting usage alerts for those node groups.
42844284
type: string
42854285
default: ""
4286-
examples: ".*redis.*|.*postgres.*"
4286+
examples:
4287+
- ".*redis.*|.*postgres.*"
42874288
diskAlerts:
42884289
title: Disk Alerts
42894290
description: Definitions for disk alerts.

0 commit comments

Comments
 (0)