-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
This would help with some basic validation; i.e., have a list of allowed labels for socials.labels (with "additionalProperties": false), link/project_link/website_link should match a URI, projects can be an array, and the rest can be strings, or anything else as applicable.
https://github.com/python-jsonschema/check-jsonschema can then be used to validate it, with something like
import json
import jsonschema
with open("maintainer.schema.json") as f:
schema = json.load(f)
with open("maintainer.json") as f:
data = json.load(f)
try:
jsonschema.validate(instance=data, schema=schema)
except jsonschema.exceptions.ValidationError as e:
# do whatever with the erroror with their built-in pre-commit hooks – perhaps those might fit better after #17 :)
idlip
Metadata
Metadata
Assignees
Labels
No labels