Skip to content

Instantly share code, notes, and snippets.

@arno-di-loreto
Created July 7, 2022 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arno-di-loreto/8f138329933e718421e52b7d7c597cd8 to your computer and use it in GitHub Desktop.
Save arno-di-loreto/8f138329933e718421e52b7d7c597cd8 to your computer and use it in GitHub Desktop.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Ruleset",
"description": "A Spectral Ruleset",
"type": "object",
"properties": {
"rules": {
"$ref": "#/$defs/Rule"
}
},
"$defs": {
"Rule": {
"title": "Rule",
"description": "A Spectral Rule",
"type": "object",
"properties": {
"description": {
"type": "string"
},
"message": {
"type": "string"
},
"severity": {
"description": "The severity of a Spectral Rule",
"type": "string",
"enum": [
"error",
"warn",
"info",
"hint"
],
"default": "warn",
"$comment": "https://meta.stoplight.io/docs/spectral/e5b9616d6d50c-custom-rulesets#severity"
},
"resolved": {
"type": "boolean"
},
"given": {
"$ref": "#/$defs/Given"
}
}
},
"Path": {
"title": "Path",
"description": "A path which can be a pure JSON Path, an alias or a aggregation of an alias and a JSON Path",
"type": "string"
},
"Given": {
"oneOf": [
{
"$ref": "#/$defs/Path"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/Path"
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment