1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-25 21:23:55 +08:00

Use unstable Json API with guarantee;

Move plugin center from ./center to ./plugin/center
This commit is contained in:
Him188 2020-06-26 18:41:27 +08:00
parent d25ff4b6e3
commit d4271f670f
2 changed files with 5 additions and 3 deletions
backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/center

View File

@ -9,7 +9,7 @@
@file:OptIn(MiraiExperimentalAPI::class)
package net.mamoe.mirai.console.center
package net.mamoe.mirai.console.plugin.center
import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO
@ -24,7 +24,9 @@ import net.mamoe.mirai.utils.MiraiExperimentalAPI
import java.io.File
@OptIn(UnstableDefault::class)
internal val json = Json(JsonConfiguration(isLenient = true, ignoreUnknownKeys = true))
internal val json = runCatching {
Json(JsonConfiguration(isLenient = true, ignoreUnknownKeys = true))
}.getOrElse { Json(JsonConfiguration.Stable) }
@OptIn(KtorExperimentalAPI::class)
internal val Http = HttpClient(CIO)

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.console.center
package net.mamoe.mirai.console.plugin.center
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable