From d6b9d5bec9c93a3299686bb5dc103bd3c90ab237 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 31 Oct 2022 16:04:21 +0100 Subject: [PATCH] Hotfix for invalid schema --- api/v0/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/v0/index.js b/api/v0/index.js index 83832f0..3f1b025 100644 --- a/api/v0/index.js +++ b/api/v0/index.js @@ -116,7 +116,7 @@ const apiProfileSchema = { } }, claim: { - type: ["array", "object"], + type: "object", properties: { format: { type: "string" }, relation: { type: "string" }, @@ -230,6 +230,13 @@ const sanitize = (data) => { for (let iClaim = 0; iClaim < user.claims.length; iClaim++) { const claim = user.claims[iClaim] + // TODO Fix upstream + for (let iMatch = 0; iMatch < claim.matches.length; iMatch++) { + const match = claim.matches[iMatch]; + if (Array.isArray(match.claim)) { + match.claim = match.claim[0] + } + } // TODO Fix upstream if (!claim.verification) { claim.verification = {}