{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "HELM monomer JSON Schema draft v1",
  "type": "object",
  "properties": {
    "symbol": {
      "description": "Short name for the monomer. This will be displayed on the canvas.",
	  "type": "string"
    },
    "name": {
      "description": "Long name for the monomer. Generally an IUPAC or commonly used trivial chemical name.",
	  "type": "string"
    },
    "molfile": {
      "description": "Molfile with carriage returns escaped.", 
	  "type": "string"
    },
    "author": {
      "description": "Name of the person who entered the monomer information.",
	  "type": "string"
    },
    "id": {
      "description": "Unique ID for the monomer. There is no meaning associated with this ID value.",
	  "type": ["string", "integer"]
    },
    "rgroups": {
      "description": "An array of the monomer R groups and required information.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "meaningless identifier for the r group",
            "type": "integer"
          },
          "alternateId": {
            "description": "Descriptive ID for the R group consisting of the label and R group plus number",
            "type": "string"
          },
          "label": {
            "description": "R followed by an integer denoting the R group number",
            "type": "string"
          },
          "capGroupName": {
            "description": "A list of the atoms in the leaving group. This is descriptive, and exists to show the user the leaving group atoms",
            "type": "string"
          },
          "capGroupSMILES": {
            "description": "SMILES of the R group, uses atom mapping notation",
            "type": "string"
          }
        },
        "required": [
          "alternateId",
          "label",
          "capGroupName",
          "capGroupSMILES"
        ]
      }
    },
    "smiles": {
      "description": "Canonical SMILES of the monomer including connection points.",
      "type": "string"
    },
    "polymerType": {
	   "description": "Type must be one of a fixed list of agreed polymer types.",
	   "type": "string",
	   "enum": ["RNA", "PEPTIDE", "CHEM"]
    },
    "naturalAnalog": {
      "description": "Natural analogue of the monomer where available.",
	  "type": "string"
    },
    "monomerType": {
      "description": "Type of monomer from a fixed list of agreed monomer types.",
	  "type": "string",
	  "enum": ["Backbone", "Branch", "Terminal", "Undefined"]
    },
    "createDate": {
      "description": "Date created.",
	  "type": ["string", "null"]
    }
  },
  "required": [
    "symbol",
    "name",
    "molfile",
    "id",
    "rgroups",
    "smiles",
    "polymerType",
    "monomerType"
  ]
}
