sentry-options-validation 1.2.10

Schema validation library and CLI for sentry-options
Documentation
{
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+$"
    },
    "type": {
      "const": "object"
    },
    "additionalProperties": {
      "type": "boolean"
    },
    "patternProperties": {
      "type": "object",
      "properties": {
        "^feature\\.": {
          "type": "object",
          "properties": {
            "$ref": {
              "type": "string",
              "pattern": "#/definitions/Feature"
            }
          },
          "required": ["$ref"],
          "additionalProperties": false
        }
      },
      "required": ["^feature\\."],
      "additionalProperties": false
    },
    "properties": {
      "type": "object",
      "patternProperties": {
        "^feature\\.": {
          "type": "object",
          "properties": {
            "$ref": {
              "type": "string",
              "pattern": "#/definitions/Feature"
            }
          },
          "required": ["$ref"],
          "additionalProperties": false
        },
        "^(?!feature\\.)": {
          "type": "object",
          "properties": {
            "type": {
              "enum": ["string", "integer", "number", "boolean", "array", "object"]
            },
            "default": {},
            "description": {
              "type": "string"
            },
            "items": {
              "$ref": "#/$defs/value_type"
            },
            "additionalProperties": {
              "$ref": "#/$defs/value_type"
            },
            "properties": {
              "$ref": "#/$defs/value_shape"
            }
          },
          "required": ["type", "default", "description"],
          "additionalProperties": false,
          "allOf": [
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "array"
                  }
                }
              },
              "then": {
                "required": ["items"]
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "object"
                  }
                },
                "not": {
                  "required": ["additionalProperties"]
                }
              },
              "then": {
                "required": ["properties"]
              }
            }
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "required": ["version", "type"],
  "anyOf": [{ "required": ["properties"] }, { "required": ["patternProperties"] }],
  "additionalProperties": false,
  "$defs": {
    "value_type": {
      "type": "object",
      "properties": {
        "type": {
          "enum": ["string", "integer", "number", "boolean", "array", "object"]
        },
        "optional": {
          "type": "boolean"
        },
        "items": {
          "$ref": "#/$defs/value_type"
        },
        "additionalProperties": {
          "$ref": "#/$defs/value_type"
        },
        "properties": {
          "$ref": "#/$defs/value_shape"
        }
      },
      "required": ["type"],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "array"
              }
            }
          },
          "then": {
            "required": ["items"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "object"
              }
            },
            "not": {
              "required": ["additionalProperties"]
            }
          },
          "then": {
            "required": ["properties"]
          }
        }
      ]
    },
    "value_shape": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/value_type"
        }
      },
      "additionalProperties": false
    }
  }
}