diff options
author | Kierán Meinhardt <kmein@posteo.de> | 2024-10-12 11:56:25 +0200 |
---|---|---|
committer | Kierán Meinhardt <kmein@posteo.de> | 2024-10-12 11:56:25 +0200 |
commit | 324ee5e50f88b5877f29164ca9c3e1c6c5161251 (patch) | |
tree | 594f1cde0fb540c4b67ddbb2f77aa780cd8371b7 /backend | |
parent | 1e1f0daa077eaf73382c09b06456947e8a9dc204 (diff) |
add date-time scalars and conform further to json schema
Diffstat (limited to 'backend')
-rw-r--r-- | backend/app/Main.hs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/backend/app/Main.hs b/backend/app/Main.hs index 063bb1a..24a110f 100644 --- a/backend/app/Main.hs +++ b/backend/app/Main.hs @@ -108,17 +108,12 @@ fromAutoTypes path (U.Object ps) = ("$id", J.toJSON @String (path <> ".schema.json")), ("title", J.toJSON @String path), ("type", J.toJSON @String "object"), - ("properties", J.toJSON (M.map toProperty ps)), + ("properties", J.toJSON ps), ("required", J.toJSON (M.keys (M.filter isRequired ps))) ] where isRequired (U.Option _) = False isRequired _ = True - toProperty :: U.T -> M.Map String String - toProperty (U.Scalar "string") = M.fromList [("type", "string")] - toProperty (U.Option (Just (U.Scalar "string"))) = M.fromList [("type", "string")] - toProperty (U.Reference i) = M.fromList [("$ref", i)] - toProperty x = error ("unhandled type: " <> show x) fromAutoTypes _ _ = error "Only JSON objects are supported." watch :: TMVar Repo -> FilePath -> G.RefName -> IO () |