scatauk / nela-api

0 stars 0 forks source link

Error handling of text elements #1

Open jplomas opened 1 month ago

jplomas commented 1 month ago

We need error checking (and tests) for text elements which do not match correct format, e.g. nodal/Nodal

jplomas commented 1 month ago

probably best to include this at schema level, as in:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "required": ["results"],
  "additionalProperties": false,
  "properties": {
    "results": {
      "type": "object",
      "properties": {
        "result": {
          "type": "string",
          "enum": ["1", "2", "3", "4"]
        }
      }
    }
  }
}