A more optimal representation of an Atom in JSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major
    • None

      A JSON Schema is a useful mechanism for specifying and verifying the structure of an Atom. A Schema can specify which elements are 'required', but specifying interdependency or mutual-exclusion (e.g. ContextTag IFF ContextValue; DeviceID XOR ConsumerID) is not straightforward. Some small changes to the structure of the Atom would make development of a schema easier - and as a consequence lighten the burden of validation in Atom processors.

      Suggestions include:

      1 Implement WHAT as an array of integers rather than four discrete elements. No need for complicated 'SubClass' is required if 'Element' is present.

      2 Implement Extension like the following:
      {
      "Int":{"IntTag": N, "IntValue": N}},
      "Str":{"StrTag": N, "StrValue": N}},
      "Flt":{"FltTag": N, "FltValue": N}}
      }
      ...so that we can make the elements Int, Str, Flt 'optional', but within them make the Tag and Value elements 'mandatory'

      3. Implement Context as
      {
      "Weather": N ### Optional
      "Ext":

      {"ContextTag": N "ContextValue":V}

      ### Optional Ext with mandatory Tag/Value
      }

            Assignee:
            Unassigned
            Reporter:
            paul.bruton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: