aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--backend/app/Main.hs1
-rw-r--r--frontend/app/Schema.hs17
2 files changed, 13 insertions, 5 deletions
diff --git a/backend/app/Main.hs b/backend/app/Main.hs
index d26259b..8bd02b2 100644
--- a/backend/app/Main.hs
+++ b/backend/app/Main.hs
@@ -91,6 +91,7 @@ fromAutoTypes path (U.Object ps) =
]
where
toProperty k (U.Scalar "string") = "string" :: String
+ toProperty k (U.Option (Just (U.Scalar "string"))) = "string?" :: String
watch :: TMVar Repo -> FilePath -> G.RefName -> IO ()
watch repoT root ref = do
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)