{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/one-service-descriptor-schema-0.1.json",
  "$ref": "#/definitions/ServiceDescriptor",
  "definitions": {
    "ServiceDescriptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string"
        },
        "requires": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Require"
          }
        },
        "events": {
          "$ref": "#/definitions/Events"
        }
      },
      "required": ["description", "requires", "events"],
      "title": "ServiceDescriptor"
    },
    "Events": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "produces": {
          "$ref": "#/definitions/Consumes"
        },
        "consumes": {
          "$ref": "#/definitions/Produces"
        }
      },
      "required": ["consumes", "produces"],
      "title": "Events"
    },
    "Consumes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "title": "Consumes"
    },
    "Produces": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "title": "Produces"
    },
    "Require": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "service": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "uses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Use"
          }
        }
      },
      "required": ["service", "uses", "version"],
      "title": "Require"
    },
    "Use": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "api": {
          "type": "string",
          "enum": ["internal", "external", "integration"]
        },
        "type": {
          "type": "string",
          "enum": ["REST", "library"]
        }
      },
      "required": ["api", "type"],
      "title": "Use"
    }
  }
}
