{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/samtrc.json",
  "additionalProperties": false,
  "definitions": {
    "level_type": {
      "enum": ["error", "warn", "info", "off"]
    },
    "naming_type": {
      "enum": [
        "PascalCase",
        "camelCase",
        "kebab-case",
        "snake_case",
        "SCREAMING_SNAKE_CASE"
      ]
    }
  },
  "properties": {
    "extends": {
      "description": "The name of the configuration file to extend from, used to determine the default rules to apply",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "enum": ["recommended", "strict"]
        }
      ]
    },
    "rules": {
      "description": "Configuration for linter rules for the current project",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "description": "Configure whether model types (e.g. record and service) must be in a separate file from their providers and consumers",
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "split-model-and-providers"
              },
              "level": {
                "$ref": "#/definitions/level_type"
              }
            },
            "additionalProperties": false
          },
          {
            "description": "Configure naming rules which apply to all types in the project",
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "naming-conventions"
              },
              "level": {
                "$ref": "#/definitions/level_type"
              },
              "record": {
                "$ref": "#/definitions/naming_type"
              },
              "recordField": {
                "$ref": "#/definitions/naming_type"
              },
              "enum": {
                "$ref": "#/definitions/naming_type"
              },
              "enumValue": {
                "$ref": "#/definitions/naming_type"
              },
              "typeAlias": {
                "$ref": "#/definitions/naming_type"
              },
              "service": {
                "$ref": "#/definitions/naming_type"
              },
              "serviceOperation": {
                "$ref": "#/definitions/naming_type"
              },
              "serviceOperationParameter": {
                "$ref": "#/definitions/naming_type"
              },
              "provider": {
                "$ref": "#/definitions/naming_type"
              },
              "package": {
                "$ref": "#/definitions/naming_type"
              },
              "fileName": {
                "$ref": "#/definitions/naming_type"
              }
            },
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": ["extends"],
  "type": "object"
}
