{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "name": "Relationship",
  "description": "Represent a Relationship in the ER model",
  "type": "object",
  "properties": {
    "$schema": {
      "enum": [
        "http://json-schema.org/draft-04/schema#"
      ]
    },
    "$schema-location": {
      "enum": [
        "Relationship-Schema-v2.json"
      ]
    },
    "name": {
      "description": "name of the Relationship",
      "type": "string"
    },
    "version": {
      "description": "version",
      "type": "string"
    },
    "author": {
      "description": "name of the author",
      "type": "string"
    },
    "description": {
      "description": "human readable description",
      "type": "string"
    },
    "associated-tool": {
      "description": "name of the associated tool (eg- Docker-Rest-API)",
      "type": "string"
    },
    "type": {
      "enum": [
        "object"
      ]
    },
    "participating-entity-schema": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "description": "name of the participating Entity",
            "type": "string"
          },
          "version": {
            "description": "version of the participating Entity",
            "type": "string"
          },
          "role": {
            "description": "role of the participating Entity this Relationship",
            "type": "string"
          },
          "cardinality": {
            "description": "Cardinality values",
            "type": "object",
            "properties": {
              "min-value": {
                "type": "string"
              },
              "max-value": {
                "type": "string"
              }
            }
          }
        },
        "minItems": 2,
        "maxItems": 2
      }
    },
    "properties": {
      "type": "object",
      "required": [
        "participating-entities"
      ],
      "properties": {
        "$schema-location": {
          "type": "object",
          "properties": {
            "type": {
              "type": "object",
              "properties": {
                "enum": {
                  "enum": [
                    "ADD YOUR SCHEMA LOCATION HERE"
                  ]
                }
              }
            }
          }
        },
        "author": {
          "type": "object",
          "properties": {
            "type": {
              "enum": [
                "string"
              ]
            }
          }
        },
        "id": {
          "type": "object",
          "properties": {
            "type": {
              "enum": [
                "string"
              ]
            }
          }
        },
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "enum": [
                "string"
              ]
            }
          }
        },
        "version": {
          "type": "object",
          "properties": {
            "type": {
              "enum": [
                "string"
              ]
            }
          }
        },
        "participating-entities": {
          "type": "object",
          "required": [
            "properties"
          ],
          "properties": {
            "items": {
              "type": "object",
              "properties": {
                "maxItems": {
                  "enum": [
                    "2"
                  ]
                },
                "minItems": {
                  "enum": [
                    "2"
                  ]
                },
                "properties": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "object",
                      "required": [
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "enum": [
                            "string"
                          ]
                        }
                      }
                    },
                    "role": {
                      "type": "object",
                      "required": [
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "enum": [
                            "string"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": {
                  "enum": [
                    true
                  ]
                },
                "type": {
                  "enum": [
                    "object"
                  ]
                }
              }
            },
            "required": {
              "enum": [
                true
              ]
            },
            "type": {
              "enum": [
                "array"
              ]
            }
          }
        }
      }
    }
  }
}