{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://reqview.com/schemas/2.7/common.json",
  "title": "ReqView Common Data Definitions",

  "definitions": {

    "nonEmptyString": {
      "description": "Non empty string",
      "type": "string",
      "minLength": 1
    },

    "numberString": {
        "description": "Non-empty string containing digits",
        "type": "string",
        "pattern": "^\\d+$"
    },

    "guid": {
      "description": "Globally unique ID automatically assigned by the application; RFC4122 version 4 compliant",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?4[0-9a-fA-F]{3}-?[89abAB][0-9a-fA-F]{3}-?[0-9a-fA-F]{12}$",
      "examples": ["e5c6889e-97da-4252-a849-1e62a1f9445d"]
    },

    "timeStamp": {
      "description": "Date and time in ISO 8601 format",
      "type": "string",
      "format": "date-time",
      "examples": ["2019-03-15T13:37:45.791Z"]
    },

    "fileName": {
      "description": "File name",
      "type": "string",
      "pattern": "^[^\\<\\>\\:\\\"\\/\\\\\\|\\?\\*]+$"
    },

    "user": {
      "description": "ReqView user",
      "type": "object",
      "properties": {
        "name": { "$ref": "#/definitions/nonEmptyString" },
        "email": {
          "type": "string",
          "format": "email"
        },
        "company": { "type": "string" }
      },
      "required": ["name", "email"],
      "examples": [{
        "name": "John Doe",
        "email": "john.doe@reqview.com",
        "company": "ReqView"
      }]
    }

  }
}
