File tree Expand file tree Collapse file tree
lithic-java-core/src/main/kotlin/com/lithic/api/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,14 +195,26 @@ private constructor(
195195
196196 val bestMatches =
197197 sequenceOf(
198- tryDeserialize(node, jacksonTypeRef<String >())?.let {
199- ConditionalValue (regex = it, _json = json)
198+ if (node.isTextual) {
199+ tryDeserialize(node, jacksonTypeRef<String >())?.let {
200+ ConditionalValue (regex = it, _json = json)
201+ }
202+ } else {
203+ null
200204 },
201- tryDeserialize(node, jacksonTypeRef<Long >())?.let {
202- ConditionalValue (number = it, _json = json)
205+ if (node.isNumber) {
206+ tryDeserialize(node, jacksonTypeRef<Long >())?.let {
207+ ConditionalValue (number = it, _json = json)
208+ }
209+ } else {
210+ null
203211 },
204- tryDeserialize(node, jacksonTypeRef<List <String >>())?.let {
205- ConditionalValue (listOfStrings = it, _json = json)
212+ if (node.isArray) {
213+ tryDeserialize(node, jacksonTypeRef<List <String >>())?.let {
214+ ConditionalValue (listOfStrings = it, _json = json)
215+ }
216+ } else {
217+ null
206218 },
207219 )
208220 .filterNotNull()
You can’t perform that action at this time.
0 commit comments