mirror of
https://github.com/jellyfin/jellyfin-sdk-kotlin.git
synced 2024-12-04 03:51:09 +00:00
Add new SyncPlayGroupUpdateHook hook
This commit is contained in:
parent
a2c8de23a9
commit
484d13a370
@ -3,11 +3,14 @@ package org.jellyfin.openapi.hooks
|
||||
import org.jellyfin.openapi.hooks.api.BinaryOperationUrlHook
|
||||
import org.jellyfin.openapi.hooks.model.ImageMapsHook
|
||||
import org.jellyfin.openapi.hooks.model.NullableReferencesHook
|
||||
import org.jellyfin.openapi.hooks.model.SyncPlayGroupUpdateHook
|
||||
import org.koin.dsl.bind
|
||||
import org.koin.dsl.module
|
||||
|
||||
val hooksModule = module {
|
||||
single { ImageMapsHook() } bind TypeBuilderHook::class
|
||||
single { NullableReferencesHook() } bind TypeBuilderHook::class
|
||||
single { SyncPlayGroupUpdateHook() } bind TypeBuilderHook::class
|
||||
|
||||
single { BinaryOperationUrlHook() } bind OperationUrlHook::class
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package org.jellyfin.openapi.hooks.model
|
||||
|
||||
import com.squareup.kotlinpoet.asTypeName
|
||||
import io.swagger.v3.oas.models.media.Schema
|
||||
import kotlinx.serialization.json.JsonElement
|
||||
import org.jellyfin.openapi.builder.openapi.OpenApiTypeBuilder
|
||||
import org.jellyfin.openapi.hooks.ModelTypePath
|
||||
import org.jellyfin.openapi.hooks.TypeBuilderHook
|
||||
import org.jellyfin.openapi.hooks.TypePath
|
||||
|
||||
/**
|
||||
* A hook that modifies the type of the "data" property in "ObjectGroupUpdate". It uses the
|
||||
* "JsonElement" type as it is now known it advance what actual type is used.
|
||||
*/
|
||||
class SyncPlayGroupUpdateHook : TypeBuilderHook {
|
||||
override fun onBuildType(path: TypePath, schema: Schema<*>, typeBuilder: OpenApiTypeBuilder) = when (path) {
|
||||
ModelTypePath("ObjectGroupUpdate", "data") -> JsonElement::class.asTypeName()
|
||||
else -> null
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user