{
   "definitions": {},
   "$schema": "http://json-schema.org/draft-07/schema#",
   "$id": "http://example.com/root.json",
   "type": "object",
   "title": "Search box result schema",
   "required": [
      "other_matches"
   ],
   "properties": {
      "exact_match": {
         "$id": "#/properties/exact_match",
         "type": "array",
         "title": "The Exact_match Schema",
         "description": "This will be the exactly matching result if the user enters a glycan, protein",
         "items": {
            "$id":"#/properties/exact_match/items",
            "type":"object",
            "description":"A category for the simple search which has an identifier (used for the search WS) and a display name.",
            "properties": {
               "type": {
                  "$id": "#/properties/exact_match/items/properties/type",
                  "type": "string",
                  "title": "The Type Schema",
                  "description": "The type of element i.e. glycan / protein",
                  "default": "",
                  "examples": [
                     "glycan",
                     "protein"
                  ]
               },
               "name": {
                  "$id": "#/properties/exact_match/items/properties/name",
                  "type": "string",
                  "title": "The Name Schema",
                  "description": "The id of the glycan / name of the protein element",
                  "default": "",
                  "examples": [
                     "G17689DH",
                     "Hepatocyte growth factor"
                  ]
               },
               "id": {
                  "$id": "#/properties/exact_match/items/properties/id",
                  "type": "string",
                  "title": "The Id Schema",
                  "description": "The ID of the glycan / protein",
                  "default": "",
                  "examples": [
                     "G17689DH",
                     "P14210-1"
                  ]
               }
            },
            "required": [
               "type",
               "name",
               "id"
            ]
         }
      },
      "other_matches": {
         "$id": "#/properties/other_matches",
         "type": "object",
         "title": "The Other_matches Schema",
         "description": "This will have the result of data where the search term matched or is mentioned",
         "required": [
            "total_match_count",
            "glycan",
            "protein",
            "glycoprotein"
         ],
         "properties": {
            "total_match_count": {
               "$id": "#/properties/other_matches/properties/total_match_count",
               "type": "integer",
               "title": "The Total_match_count Schema",
               "description": "This will show the total of other_matches results found. Can be used to know if no results are found",
               "default": 0,
               "examples": [
                  7
               ]
            },
            "glycan": {
               "$id": "#/properties/other_matches/properties/glycan",
               "type": "object",
               "title": "The Glycan Schema",
               "description": "This will have results leading to glycan_list page",
               "required": [
                  "N-glycan",
                  "O-glycan"
               ],
               "properties": {
                  "N-glycan": {
                     "$id": "#/properties/other_matches/properties/glycan/properties/N-glycan",
                     "type": "object",
                     "title": "The N-glycan Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/glycan/properties/N-glycan/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              3
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/glycan/properties/N-glycan/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ]
                        }
                     }
                  },
                  "O-glycan": {
                     "$id": "#/properties/other_matches/properties/glycan/properties/O-glycan",
                     "type": "object",
                     "title": "The O-glycan Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/glycan/properties/O-glycan/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              0
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/glycan/properties/O-glycan/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ]
                        }
                     }
                  }
               }
            },
            "protein": {
               "$id": "#/properties/other_matches/properties/protein",
               "type": "object",
               "title": "The Protein Schema",
               "description": "This will have results leading to protein_list page",
               "required": [
                  "gene",
                  "Function"
               ],
               "properties": {
                  "gene": {
                     "$id": "#/properties/other_matches/properties/protein/properties/gene",
                     "type": "object",
                     "title": "The Gene Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/protein/properties/gene/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              0
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/protein/properties/gene/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ]
                        }
                     }
                  },
                  "Function": {
                     "$id": "#/properties/other_matches/properties/protein/properties/Function",
                     "type": "object",
                     "title": "The Function Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/protein/properties/Function/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              4
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/protein/properties/Function/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ]
                        }
                     }
                  }
               }
            },
            "glycoprotein": {
               "$id": "#/properties/other_matches/properties/glycoprotein",
               "type": "object",
               "title": "The Glycoprotein Schema",
               "description": "This will have results leading to glycoprotein_list page",
               "required": [
                  "gene",
                  "Function"
               ],
               "properties": {
                  "gene": {
                     "$id": "#/properties/other_matches/properties/glycoprotein/properties/gene",
                     "type": "object",
                     "title": "The Gene Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/glycoprotein/properties/gene/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              2
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/glycoprotein/properties/gene/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ]
                        }
                     }
                  },
                  "Function": {
                     "$id": "#/properties/other_matches/properties/glycoprotein/properties/Function",
                     "type": "object",
                     "title": "The Function Schema",
                     "required": [
                        "count",
                        "list_ID"
                     ],
                     "properties": {
                        "count": {
                           "$id": "#/properties/other_matches/properties/glycoprotein/properties/Function/properties/count",
                           "type": "integer",
                           "title": "The Count Schema",
                           "description": "total results found of this sub-category",
                           "default": 0,
                           "examples": [
                              0
                           ]
                        },
                        "list_ID": {
                           "$id": "#/properties/other_matches/properties/glycoprotein/properties/Function/properties/list_ID",
                           "type": "string",
                           "title": "The List_id Schema",
                           "description": "URL to the list page of matching records",
                           "default": "",
                           "examples": [
                              ""
                           ],
                           "pattern": "^(.*)$"
                        }
                     }
                  }
               }
            }
         }
      }
   }
}