Check criteria

This commit is contained in:
Xavi Aracil 2023-10-03 10:43:00 -04:00
parent cc6dbbcd37
commit be3ebb1231

View File

@ -93,6 +93,11 @@ public class CredentialSubjectProbe extends Probe<JsonNode> {
} }
} }
} }
// criteria must have id or narrative
JsonNode criteria = achievement.get("criteria");
if (!criteria.has("id") && !criteria.has("narrative")) {
return error("criteria in achievement of credentialSubject must have id or narrative", ctx);
}
} else if (achivementRequired) { } else if (achivementRequired) {
return error("missing required achievement in credentialSubject", ctx); return error("missing required achievement in credentialSubject", ctx);
} }