feat: でシリアライザーを変更

This commit is contained in:
usbharu 2023-03-30 19:36:19 +09:00
parent 3723e438d3
commit e97a3e9e96
1 changed files with 10 additions and 0 deletions

View File

@ -3,10 +3,14 @@ package dev.usbharu.hideout.ap
import com.fasterxml.jackson.annotation.JsonAutoDetect import com.fasterxml.jackson.annotation.JsonAutoDetect
import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.core.TreeNode
import com.fasterxml.jackson.databind.JsonDeserializer
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
open class JsonLd { open class JsonLd {
@JsonProperty("@context") @JsonProperty("@context")
@JsonDeserialize(using = ContextDeserializer::class)
var context:List<String> = emptyList() var context:List<String> = emptyList()
@JsonCreator @JsonCreator
@ -16,3 +20,9 @@ open class JsonLd {
protected constructor() protected constructor()
} }
public class ContextDeserializer : JsonDeserializer<List<String>>() {
override fun deserialize(p0: com.fasterxml.jackson.core.JsonParser?, p1: com.fasterxml.jackson.databind.DeserializationContext?): List<String> {
return emptyList()
}
}