mirror of
https://github.com/jellyfin/jellyfin-sdk-kotlin.git
synced 2025-02-17 06:37:29 +00:00
Update @OptIn annotations (#368)
This commit is contained in:
parent
a56bdbf340
commit
18c9883818
@ -20,7 +20,6 @@ import org.jellyfin.sdk.model.socket.IncomingSocketMessage
|
||||
import org.jellyfin.sdk.model.socket.OutgoingSocketMessage
|
||||
import org.jellyfin.sdk.model.socket.RawIncomingSocketMessage
|
||||
|
||||
@OptIn(InternalSerializationApi::class)
|
||||
public object ApiSerializer {
|
||||
private const val SOCKET_MESSAGE_DATA = "Data"
|
||||
private const val SOCKET_MESSAGE_MESSAGE_ID = "MessageId"
|
||||
@ -37,6 +36,7 @@ public object ApiSerializer {
|
||||
encodeDefaults = true
|
||||
}
|
||||
|
||||
@OptIn(InternalSerializationApi::class)
|
||||
public fun encodeRequestBody(requestBody: Any? = null): String? {
|
||||
if (requestBody == null) return null
|
||||
|
||||
@ -49,7 +49,7 @@ public object ApiSerializer {
|
||||
else -> json.decodeFromString(responseBody.readRemaining().readText())
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)
|
||||
public fun encodeSocketMessage(message: OutgoingSocketMessage): String {
|
||||
// Serialize with default serializer
|
||||
val serializer = message::class.serializer() as KSerializer<Any>
|
||||
|
@ -12,7 +12,6 @@ import org.jellyfin.openapi.hooks.TypePath
|
||||
* In the 10.7 API specification the value of the map is incorrectly labelled as not-null.
|
||||
* This hook changes the type to the exact type emitted from the 10.8 alpha API specification.
|
||||
*/
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
class DisplayPreferencesDtoNullabilityFixHook : TypeBuilderHook {
|
||||
override fun onBuildType(path: TypePath, schema: Schema<*>, typeBuilder: OpenApiTypeBuilder) = when (path) {
|
||||
ModelTypePath("DisplayPreferencesDto", "customPrefs") -> typeNameOf<Map<String, String?>>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user