aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:20:13 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:20:13 +0200
commitd39c1665f842bb93fd2c7e291a11aa000120350c (patch)
treeb49e8f320bab305905b76a182aa18488fc36e56a /frontend
parentc7d0139116ff5c12ffa4c11dbfee697dbf694c46 (diff)
add `string?`-typed fields
Diffstat (limited to 'frontend')
-rw-r--r--frontend/app/Schema.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/frontend/app/Schema.hs b/frontend/app/Schema.hs
index 517439d..ee958d8 100644
--- a/frontend/app/Schema.hs
+++ b/frontend/app/Schema.hs
@@ -100,11 +100,18 @@ schemaForm schema =
fmap mergeJson . sequence $
case schema.type_ of
Object properties ->
- ( \(AK.fromString -> k, "string") ->
- A.Object . AM.singleton k
- <$> ( F.mapValues (getO k) (setO k) $
- jsonString (AK.toString k)
- )
+ ( \(AK.fromString -> k, v) ->
+ case v of
+ "string" ->
+ A.Object . AM.singleton k
+ <$> ( F.mapValues (getO k) (setO k) $
+ jsonString (AK.toString k)
+ )
+ "string?" ->
+ A.Object . AM.singleton k
+ <$> ( F.mapValues (getO k) (setO k) $
+ jsonString (AK.toString k)
+ )
)
<$> (M.toList properties)