{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "Program Validation Response Schema",
  "description": "Defines the validation results returned by the program when requested for program requirements",
  "type": "object",
  "properties": {
    "validationResults": {
      "type": "array",
      "title": "Validation Results",
      "description": "A list of errors or success messages in response to validating the requirements",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "title": "Requirement Key",
            "description": "The key of the requirement associated with the listed validation results"
          },
          "results": {
            "type": "array",
            "title": "Requirement Validation Results",
            "description": "The results associated with the validation requirement key",
            "items": {
              "$ref": "#/definitions/validationResult"
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "results"
        ]
      }
    }
  },
  "required": [
    "validationResults"
  ],
  "additionalProperties": false,
  "definitions": {
    "validationResult": {
      "type": "object",
      "title": "Requirement Validation Result",
      "description": "A result of validating a requirement",
      "properties": {
        "status": {
          "type": "string",
          "title": "Validation Status",
          "description": "A status indicating whether the validation was successful or the severity of the error",
          "enum": [
            "SUCCESS",
            "WARN",
            "ERROR"
          ]
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "A message indicating why the validation was successful or not"
        },
        "longDescription": {
          "type": "string",
          "title": "Long Description",
          "description": "A more detailed description of why the validation was not successful and what can be done to resolve it"
        }
      },
      "required": [
        "status",
        "message"
      ]
    }
  }
}