Fix enum values in config_schema.yml (must be arrays) - #19
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18
enum: counter/enum: gaugeshould beenum: [counter]/enum: [gauge]— per the JSON Schema spec,enummust be an array, not a bare string.With an older/laxer
jsonschemaversion this may have gone unnoticed, but with a recent one (tested with 4.26.0, which satisfies thejsonschema = "^4.20.0"constraint inpyproject.toml), the schema itself fails meta-schema validation before it can validate any instance:This means any config using a
gaugeorcountermetric — including the exampleconfig.ymlshipped in this repo — currently fails to load.One-line fix, no behavior change beyond making the schema actually valid.