{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ibm-api-connect/json-schema/ibm-api-connect-ruleset-request-schema.json",
  "title": "RulesetRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibm-api-connect-rulesets-and-rules-api-openapi.yml#/components/schemas/RulesetRequest",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "ruleset_version": {
      "type": "string",
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 65535
    },
    "ruleset_type": {
      "type": "string",
      "enum": [
        "global-ibm",
        "global-spectral",
        "global-custom",
        "custom"
      ]
    },
    "ruleset_format_type": {
      "type": "string",
      "enum": [
        "1",
        "2"
      ]
    },
    "visibility": {
      "$ref": "#/$defs/ResourceVisibility"
    },
    "rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RuleRequest"
      }
    }
  },
  "$defs": {
    "ResourceVisibility": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "custom"
          ]
        },
        "org_urls": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "RuleRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 255
        },
        "description": {
          "type": "string",
          "maxLength": 65535
        },
        "message": {
          "type": "string"
        },
        "recommended": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "given": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warn",
            "info",
            "hint",
            "off"
          ]
        },
        "formats": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "oas2",
              "oas3",
              "oas3_0",
              "oas3_1",
              "aas2",
              "aas3_0"
            ]
          }
        },
        "resolved": {
          "type": "boolean"
        },
        "then": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}