Skip to content

Commit ef53d75

Browse files
authored
Get rid of deprecated API and replacements (#1111)
1 parent f7f1bcc commit ef53d75

File tree

56 files changed

+137
-2592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+137
-2592
lines changed

core/api/kotlinx-serialization-core.api

Lines changed: 8 additions & 289 deletions
Large diffs are not rendered by default.

core/commonMain/src/kotlinx/serialization/Annotations.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,6 @@ public annotation class Transient
142142
@ExperimentalSerializationApi
143143
public annotation class SerialInfo
144144

145-
/**
146-
* Commands to use [ContextualSerializer] on an annotated property or type usage.
147-
* If used on a file, commands using [ContextualSerializer] for all listed KClasses.
148-
*
149-
* @param [forClasses] Classes to use ContextualSerializer for in the current file.
150-
*/
151-
@Deprecated(
152-
"This annotation had several meanings and was split in two for readability: use @Contextual on properties and @UseContextualSerialization on files.",
153-
ReplaceWith("Contextual"),
154-
level = DeprecationLevel.ERROR
155-
)
156-
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FILE, AnnotationTarget.TYPE)
157-
@Retention(AnnotationRetention.BINARY)
158-
public annotation class ContextualSerialization(vararg val forClasses: KClass<*>)
159-
160145
/**
161146
* Instructs the plugin to use [ContextSerializer] on a given property or type.
162147
* Context serializer is usually used when serializer for type can only be found in runtime.

core/commonMain/src/kotlinx/serialization/ContextualSerializer.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,3 @@ public class ContextualSerializer<T : Any>(
6363
return decoder.decodeSerializableValue(serializer)
6464
}
6565
}
66-
67-
@Deprecated("Renamed", ReplaceWith("ContextualSerializer"), level = DeprecationLevel.ERROR)
68-
public typealias ContextSerializer<T> = ContextualSerializer<T>

core/commonMain/src/kotlinx/serialization/KSerializer.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package kotlinx.serialization
77
import kotlinx.serialization.descriptors.*
88
import kotlinx.serialization.descriptors.elementNames
99
import kotlinx.serialization.encoding.*
10-
import kotlinx.serialization.encoding.updateModeDeprecated
1110

1211
/**
1312
* KSerializer is responsible for the representation of a serial form of a type [T]
@@ -65,9 +64,6 @@ public interface KSerializer<T> : SerializationStrategy<T>, DeserializationStrat
6564
* to introspect the type, infer the schema or to compare against the predefined schema.
6665
*/
6766
override val descriptor: SerialDescriptor
68-
69-
@Deprecated(patchDeprecated, level = DeprecationLevel.ERROR)
70-
override fun patch(decoder: Decoder, old: T): T = throw UnsupportedOperationException("Not implemented, should not be called")
7167
}
7268

7369
/**
@@ -177,20 +173,5 @@ public interface DeserializationStrategy<T> {
177173
* ```
178174
*/
179175
public fun deserialize(decoder: Decoder): T
180-
181-
@Deprecated(patchDeprecated, level = DeprecationLevel.ERROR)
182-
public fun patch(decoder: Decoder, old: T): T
183-
}
184-
185-
// Can't be error yet because it's impossible to add default implementations for `val updateMode` in Decoder:
186-
// 'Class JsonDecoder must implement updateMode because it inherits it from multiple interfaces'
187-
// so users will have it in signature until we delete updateMode
188-
@Deprecated(updateModeDeprecated, level = DeprecationLevel.WARNING)
189-
@Suppress("NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING")
190-
public enum class UpdateMode {
191-
BANNED, OVERWRITE, UPDATE
192176
}
193177

194-
internal const val patchDeprecated =
195-
"Patch function is deprecated for removal since this functionality is no longer supported by serializer." +
196-
"Some formats may provide implementation-specific patching in their Decoders."

0 commit comments

Comments
 (0)