Skip to content

Commit

Permalink
Merge pull request #389 from charleskorn/renovate/org.jetbrains.kotli…
Browse files Browse the repository at this point in the history
…nx-kotlinx-serialization-core-1.x

Update dependency org.jetbrains.kotlinx:kotlinx-serialization-core to v1.5.0
  • Loading branch information
charleskorn authored Feb 25, 2023
2 parents 21cf60c + ce1f70a commit a9fcb95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ kotlin {

val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.0")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ internal class YamlPolymorphicInput(private val typeName: String, private val ty

private fun throwIfUnknownPolymorphicTypeException(e: Exception, deserializer: DeserializationStrategy<*>) {
val message = e.message ?: return
val match = unknownPolymorphicTypeExceptionMessage.matchEntire(message) ?: return
val match = unknownPolymorphicTypeExceptionMessage.matchAt(message, 0) ?: return
val unknownType = match.groupValues[1]
val className = match.groupValues[2]

Expand Down Expand Up @@ -146,7 +146,7 @@ internal class YamlPolymorphicInput(private val typeName: String, private val ty
}

@ExperimentalSerializationApi
override fun <Base : Any> polymorphicDefaultDeserializer(baseClass: KClass<Base>, defaultDeserializerProvider: (className: String?) -> DeserializationStrategy<out Base>?) {
override fun <Base : Any> polymorphicDefaultDeserializer(baseClass: KClass<Base>, defaultDeserializerProvider: (className: String?) -> DeserializationStrategy<Base>?) {
throw UnsupportedOperationException("This method should never be called")
}
})
Expand All @@ -161,6 +161,6 @@ internal class YamlPolymorphicInput(private val typeName: String, private val ty
}

companion object {
private val unknownPolymorphicTypeExceptionMessage: Regex = """^Class '(.*)' is not registered for polymorphic serialization in the scope of '(.*)'.\nMark the base class as 'sealed' or register the serializer explicitly.$""".toRegex()
private val unknownPolymorphicTypeExceptionMessage: Regex = """^Class '(.*)' is not registered for polymorphic serialization in the scope of '(.*)'.\n.*""".toRegex()
}
}

0 comments on commit a9fcb95

Please sign in to comment.