Skip to content

Fix enum values in config_schema.yml (must be arrays) - #19

Merged
jannistpl merged 2 commits into
gonicus:masterfrom
DougNeo:fix-config-schema-enum
Sep 14, 2026
Merged

jannistpl merged 2 commits into
gonicus:masterfrom
DougNeo:fix-config-schema-enum

Conversation

@DougNeo

@DougNeo DougNeo commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #18

enum: counter / enum: gauge should be enum: [counter] / enum: [gauge] — per the JSON Schema spec, enum must be an array, not a bare string.

With an older/laxer jsonschema version this may have gone unnoticed, but with a recent one (tested with 4.26.0, which satisfies the jsonschema = "^4.20.0" constraint in pyproject.toml), the schema itself fails meta-schema validation before it can validate any instance:

'gauge' is not of type 'array'

This means any config using a gauge or counter metric — including the example config.yml shipped in this repo — currently fails to load.

One-line fix, no behavior change beyond making the schema actually valid.

DougNeo and others added 2 commits September 10, 2026 12:41
The 'type' property under value_type_counter and value_type_gauge used
'enum: counter' / 'enum: gauge' -- per the JSON Schema spec, enum must
be an array. With a recent jsonschema library version this causes the
schema itself to fail meta-schema validation, so any config using a
gauge or counter metric (including the example config.yml shipped in
this repo) fails to load with "'gauge' is not of type 'array'".

Fixes gonicus#18

@jannistpl jannistpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR!

@jannistpl
jannistpl merged commit 3747fd0 into gonicus:master Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config_schema.yml: 'enum' with a bare string instead of a list breaks validation on newer jsonschema

2 participants