mirror of
https://github.com/jellyfin/jellyfin-sdk-kotlin.git
synced 2024-11-26 23:50:32 +00:00
Remove DisplayPreferencesDtoNullabilityFixHook
This commit is contained in:
parent
d37b0e2bcf
commit
2a9dd0f1ba
@ -3,7 +3,6 @@ package org.jellyfin.openapi.hooks
|
||||
import org.jellyfin.openapi.hooks.api.BinaryOperationUrlHook
|
||||
import org.jellyfin.openapi.hooks.api.PlayStateServiceNameHook
|
||||
import org.jellyfin.openapi.hooks.model.DefaultUserIdHook
|
||||
import org.jellyfin.openapi.hooks.model.DisplayPreferencesDtoNullabilityFixHook
|
||||
import org.jellyfin.openapi.hooks.model.ImageMapsHook
|
||||
import org.jellyfin.openapi.hooks.model.SyncPlayGroupUpdateHook
|
||||
import org.koin.dsl.bind
|
||||
@ -12,7 +11,6 @@ import org.koin.dsl.module
|
||||
val hooksModule = module {
|
||||
single { ImageMapsHook() } bind TypeBuilderHook::class
|
||||
single { SyncPlayGroupUpdateHook() } bind TypeBuilderHook::class
|
||||
single { DisplayPreferencesDtoNullabilityFixHook() } bind TypeBuilderHook::class
|
||||
|
||||
single { BinaryOperationUrlHook() } bind OperationUrlHook::class
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
package org.jellyfin.openapi.hooks.model
|
||||
|
||||
import com.squareup.kotlinpoet.typeNameOf
|
||||
import io.swagger.v3.oas.models.media.Schema
|
||||
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 "customPrefs" property in "DisplayPreferencesDto" to fix a nullability issue.
|
||||
* 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.
|
||||
*/
|
||||
class DisplayPreferencesDtoNullabilityFixHook : TypeBuilderHook {
|
||||
override fun onBuildType(path: TypePath, schema: Schema<*>, typeBuilder: OpenApiTypeBuilder) = when (path) {
|
||||
ModelTypePath("DisplayPreferencesDto", "customPrefs") -> typeNameOf<Map<String, String?>>()
|
||||
else -> null
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user