Skip to content

Commit

Permalink
Cancel the detection of all values of backup (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
LowEntropyBody committed Oct 22, 2020
1 parent 2bd2ca4 commit b652cff
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions generator/schema/identity.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,12 @@ const { logger } = require('../logger')

const backupSchema = Joi.object({
address: Joi.string().required(),
encoded: Joi.string().required(),
encoding: Joi.object({
content: Joi.array().items(Joi.string()).min(1).required(),
type: [Joi.array().items(Joi.string()).required(), Joi.string().required()],
version: Joi.string().required(),
}).required(),
meta: Joi.object({
genesisHash: Joi.string().length(66).regex(/^0x[0-9a-f]+$/).allow(null),
name: Joi.string().required(),
tags: Joi.array().items(Joi.string()),
whenCreated: Joi.date().timestamp().raw(),
}),
})

const identitySchema = Joi.object({
backup: Joi.string().custom((value, helpers) => {
try {
const result = backupSchema.validate(JSON.parse(value))
const result = backupSchema.validate(JSON.parse(value), {allowUnknown: true})
if (result.error) {
return helpers.error(result.error)
}
Expand Down

0 comments on commit b652cff

Please sign in to comment.