From 677e547add4477a0cfdf84a6ed15a492e2cf2d29 Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Wed, 4 Jan 2023 12:27:31 +0100 Subject: [PATCH] Get credentialSchema node list using utility method --- .../org/oneedtech/inspect/vc/probe/InlineJsonSchemaProbe.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/InlineJsonSchemaProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/InlineJsonSchemaProbe.java index 30c4324..e0ec3f7 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/InlineJsonSchemaProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/InlineJsonSchemaProbe.java @@ -12,6 +12,7 @@ import org.oneedtech.inspect.core.probe.json.JsonSchemaProbe; import org.oneedtech.inspect.core.report.ReportItems; import org.oneedtech.inspect.schema.SchemaKey; import org.oneedtech.inspect.vc.VerifiableCredential; +import org.oneedtech.inspect.vc.util.JsonNodeUtil; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -42,7 +43,7 @@ public class InlineJsonSchemaProbe extends Probe { JsonNode credentialSchemaNode = root.get("credentialSchema"); if(credentialSchemaNode == null) return success(ctx); - ArrayNode schemas = (ArrayNode) credentialSchemaNode; //TODO guard this cast + List schemas = JsonNodeUtil.asNodeList(credentialSchemaNode); for(JsonNode schemaNode : schemas) { JsonNode typeNode = schemaNode.get("type");