Validate contribution docs against schema

Currently requires an open PR branch for the schemas, which is adding
date and time for contributions.

refs #30
This commit is contained in:
2019-04-10 18:37:02 +02:00
parent 1aae62e139
commit 130e2a7797
5 changed files with 116 additions and 90 deletions

View File

@@ -14,6 +14,8 @@ class Contribution {
*/
static deserialize(serialized) {
let {
date,
time,
kind,
description,
details,
@@ -21,6 +23,8 @@ class Contribution {
} = JSON.parse(serialized.toString('utf8'));
return {
date,
time,
kind,
description,
details,
@@ -38,6 +42,8 @@ class Contribution {
static serialize(deserialized) {
let {
contributorIpfsHash,
date,
time,
kind,
description,
url,
@@ -50,6 +56,8 @@ class Contribution {
"contributor": {
"ipfs": contributorIpfsHash
},
date,
time,
kind,
description,
"details": details || {}