Skip to content

Commit 520cacb

Browse files
committed
fix: failing example
1 parent 8a99156 commit 520cacb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,18 @@ internal open class StreamingJsonDecoder(
239239
val key = decodeStringKey()
240240
lexer.consumeNextToken(COLON)
241241
val index = descriptor.getJsonNameIndex(json, key)
242+
currentIndex = index
242243

243244
if (index == UNKNOWN_NAME) {
244245
handleUnknown(descriptor, key)
245-
currentIndex = UNKNOWN_NAME
246246
continue
247247
}
248248

249249
if (configuration.coerceInputValues && coerceInputValue(descriptor, index)) {
250250
continue
251251
}
252+
252253
elementMarker?.mark(index)
253-
currentIndex = index
254254
return index
255255
}
256256

0 commit comments

Comments
 (0)