ssbc / ssb-schema-definitions

Standardised schema definitions for ssb message types using is-my-json-valid
3 stars 1 forks source link

Bug in recps property #2

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago

Note to myself to fix this for Oasis!

Found this lovely recps in the wild:

{
  // [...]
  "recps": [
    "@abc[...]",
    {
      "link": "@def[...]",
      "name": "dan"
    },
    {
      "link": "@ghi[...]",
      "name": "gabby"
    },
    {
      "link": "@jkl[...]",
      "name": "jerry"
    },
    {
      "link": "@mno[...]",
      "name": "marsha"
    }
  ]
}

It looks like ssb-schema-definitions is saying that this is not a valid recps, probably because of the lone @abc.

christianbundy commented 4 years ago

Solution seems to be un-commenting this line: https://github.com/ssbc/ssb-schema-definitions/blob/master/definition/primitives.js#L49

dominictarr commented 4 years ago

yeah, you should accept a mix of both of these but preferably only accept an array of feed ids... (just checking, looks like that is the typical format)

christianbundy commented 4 years ago

More discussion here, btw: https://github.com/ssbc/ssb-schema-definitions/issues/2