From e66534eefb5979c1ec5e0a28e9c29969ae2c9884 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Sun, 13 Oct 2024 11:55:20 +0200 Subject: improve REST API --- frontend/app/Schema.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'frontend/app/Schema.hs') 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 -- cgit v1.2.3