DeserializationFeature.UNWRAP_ROOT_VALUE);
final ObjectNode recordNode = reader.readTree(jsonParser);
final JsonNode recordTypeNode = recordNode.get(TYPE_FIELD_NAME);
if (recordTypeNode == null) {
throw new JsonDeserializationException(
JsonDeserializationExceptionCode.missingField,
TYPE_FIELD_NAME, "resource record");
}
final String recordType = recordTypeNode.textValue();
final Class<? extends Record> recordClass = recordClassesRegistry
.get(recordType);
if (recordClass == null) {
throw new JsonDeserializationException(
JsonDeserializationExceptionCode.unknownResourceRecordType,
recordType);
}
return reader.withType(recordClass).readValue(recordNode.toString());
}