add string?-typed fields
This commit is contained in:
@@ -91,6 +91,7 @@ fromAutoTypes path (U.Object ps) =
|
|||||||
]
|
]
|
||||||
where
|
where
|
||||||
toProperty k (U.Scalar "string") = "string" :: String
|
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 :: TMVar Repo -> FilePath -> G.RefName -> IO ()
|
||||||
watch repoT root ref = do
|
watch repoT root ref = do
|
||||||
|
|||||||
@@ -100,11 +100,18 @@ schemaForm schema =
|
|||||||
fmap mergeJson . sequence $
|
fmap mergeJson . sequence $
|
||||||
case schema.type_ of
|
case schema.type_ of
|
||||||
Object properties ->
|
Object properties ->
|
||||||
( \(AK.fromString -> k, "string") ->
|
( \(AK.fromString -> k, v) ->
|
||||||
A.Object . AM.singleton k
|
case v of
|
||||||
<$> ( F.mapValues (getO k) (setO k) $
|
"string" ->
|
||||||
jsonString (AK.toString k)
|
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)
|
<$> (M.toList properties)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user