type property is an string node, not an array
This commit is contained in:
parent
904c97aced
commit
c47a04aa8c
@ -25,7 +25,7 @@ public class Assertion extends Credential {
|
||||
protected Assertion(Resource resource, JsonNode data, String jwt, Map<String, SchemaKey> schemas) {
|
||||
super(ID, resource, data, jwt, schemas);
|
||||
|
||||
ArrayNode typeNode = (ArrayNode)jsonData.get("type");
|
||||
JsonNode typeNode = jsonData.get("type");
|
||||
this.assertionType = Assertion.Type.valueOf(typeNode);
|
||||
}
|
||||
|
||||
@ -63,16 +63,13 @@ public class Assertion extends Credential {
|
||||
Assertion,
|
||||
Unknown;
|
||||
|
||||
public static Assertion.Type valueOf (ArrayNode typeArray) {
|
||||
if(typeArray != null) {
|
||||
Iterator<JsonNode> iter = typeArray.iterator();
|
||||
while(iter.hasNext()) {
|
||||
String value = iter.next().asText();
|
||||
public static Assertion.Type valueOf (JsonNode typeNode) {
|
||||
if(typeNode != null) {
|
||||
String value = typeNode.asText();
|
||||
if(value.equals("Assertion")) {
|
||||
return Assertion;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Unknown;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user