we could use these jsonschemas to do runtime validation on entry to database and on retrieval to database, as well as identifying data types.
the unfortunate thing is that rxdb does not allow option jsonschemas: i.e this collection has a Block OR a Page in it. I suggest solving this by each key/type combination being the same accross types. For example, the key blocks is always a list of strings, no matter on which data type it is on. Then, I would include this key as optional on the doc datatype.
Another question is which schema library we would like to use. rxdb accepts jsonschema, so that is the likely winner, although there are other options out there.
we could use these jsonschemas to do runtime validation on entry to database and on retrieval to database, as well as identifying data types.
the unfortunate thing is that
rxdb
does not allow option jsonschemas: i.e this collection has a Block OR a Page in it. I suggest solving this by each key/type combination being the same accross types. For example, the keyblocks
is always a list of strings, no matter on which data type it is on. Then, I would include this key as optional on the doc datatype.Another question is which schema library we would like to use. rxdb accepts jsonschema, so that is the likely winner, although there are other options out there.