Commit 09c57a88 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix resource builder input type.

parent dc795777
Pipeline #15781 passed with stage
in 2 minutes and 7 seconds
...@@ -24,7 +24,7 @@ import ch.memobase.mapping.fields.MappedAnnotationField ...@@ -24,7 +24,7 @@ import ch.memobase.mapping.fields.MappedAnnotationField
import mapping.MapperConfiguration import mapping.MapperConfiguration
class ResourceBuilder( class ResourceBuilder(
private val source: Map<String, String>, private val source: Map<String, Any>,
private val config: MapperConfiguration, private val config: MapperConfiguration,
private val institutionId: String, private val institutionId: String,
private val recordSetId: String, private val recordSetId: String,
...@@ -53,8 +53,8 @@ class ResourceBuilder( ...@@ -53,8 +53,8 @@ class ResourceBuilder(
fun extractRecordTypeValue(): ResourceBuilder { fun extractRecordTypeValue(): ResourceBuilder {
recordTypeValue = when (val recordType = config.recordType) { recordTypeValue = when (val recordType = config.recordType) {
is MappedAnnotationField -> source[recordType.field].let { is MappedAnnotationField -> source[recordType.field].let {
if (it.isNullOrEmpty()) { if (it !is String) {
errorMessage = "No type for record in field '${recordType.field} for source $source." errorMessage = "No type for record in field '${recordType.field}' for source $source."
"" ""
} else { } else {
it it
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment