From 44bab8c0c7316f72ab6787a28c5683c9a602d51e Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:51:00 -0400 Subject: [PATCH] [+] Add "type" field to settings/get --- src/main/java/icu/samnyan/aqua/net/SettingsApi.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/icu/samnyan/aqua/net/SettingsApi.kt b/src/main/java/icu/samnyan/aqua/net/SettingsApi.kt index f88a6860..9a2b12af 100644 --- a/src/main/java/icu/samnyan/aqua/net/SettingsApi.kt +++ b/src/main/java/icu/samnyan/aqua/net/SettingsApi.kt @@ -7,6 +7,7 @@ import icu.samnyan.aqua.net.db.AquaNetUserRepo import icu.samnyan.aqua.net.db.AquaUserServices import org.springframework.web.bind.annotation.RestController import kotlin.reflect.full.findAnnotation +import kotlin.reflect.jvm.jvmErasure @RestController @API("/api/v2/settings") @@ -22,7 +23,8 @@ class SettingsApi( val fieldDesc = fields.map { (f, an) -> mapOf( "key" to f.name, "name" to an.name, - "desc" to an.desc + "desc" to an.desc, + "type" to f.returnType.jvmErasure.simpleName ) } @API("get")