aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Schema.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-10-13 11:55:20 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-10-13 11:55:20 +0200
commite66534eefb5979c1ec5e0a28e9c29969ae2c9884 (patch)
tree3b919222ab147741cb9332537997e590b104eb01 /frontend/app/Schema.hs
parent997442c6b99bef99c429d4ab7f676fdf9ae09096 (diff)
improve REST API
Diffstat (limited to 'frontend/app/Schema.hs')
-rw-r--r--frontend/app/Schema.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/app/Schema.hs b/frontend/app/Schema.hs
index 8e49d47..c15e1d1 100644
--- a/frontend/app/Schema.hs
+++ b/frontend/app/Schema.hs
@@ -9,6 +9,9 @@ module Schema
)
where
+#ifdef ghcjs_HOST_OS
+import Data.Text qualified as T
+#endif
import Control.Applicative ((<|>))
import Data.Aeson qualified as A
import Data.Aeson.Key qualified as AK
@@ -42,6 +45,11 @@ instance A.FromJSON Schema where
<*> v A..: "title"
<*> v A..: "type"
+#ifdef ghcjs_HOST_OS
+instance A.FromJSONKey MisoString where
+ parseJSON = fromMisoString @T.Text <$> parseJSON
+#endif
+
data Property
= Type MisoString
| Reference MisoString