on develop help sign in
Adding JSONValue support for 'any' types
commitcff18f570c6502cc7b260f6fb9179ab4e29a4d67 authorBrendan Hay <brendan.g.hay@gmail.com> dateSun 11 Oct 2015, 13:21 (11 years ago) parent6c8754e
4 files changed+6−1
gen/src/Gen/AST/Solve.hs+1 gen/src/Gen/Syntax.hs+2 gen/src/Gen/Types.hs+2−1 gen/src/Gen/Types/Schema.hs+1
gen/src/Gen/AST/Solve.hs+1
@@ -137,6 +137,7 @@ getDerive g = loc "getDerive" g $ memo derived g go
137137 Alt _ -> DRead : base
138138 Key -> DRead : base
139139 OAuthToken -> DRead : base
140+ JSONValue -> DRead : base
140141 -- FIXME: Add numeric cases
141142 _ -> [DRead, DNum, DIntegral, DReal] <> enum
142143
gen/src/Gen/Syntax.hs+2
@@ -461,6 +461,7 @@ externalLit = \case
461461 Key -> TyCon "AuthKey"
462462 OAuthToken -> TyCon "OAuthToken"
463463 Body -> TyCon "Stream"
464+ JSONValue -> TyCon "JSONValue"
464465
465466internalLit :: Lit -> Type
466467internalLit = \case
@@ -482,6 +483,7 @@ internalLit = \case
482483 Key -> TyCon "AuthKey"
483484 OAuthToken -> TyCon "OAuthToken"
484485 Body -> TyCon "Stream"
486+ JSONValue -> TyCon "JSONValue"
485487
486488mapping :: TType -> Exp -> Exp
487489mapping t e = infixE e "." (go t)
gen/src/Gen/Types.hs+2−1
@@ -332,7 +332,8 @@ initial s = Memo s mempty mempty res core mempty mempty mempty
332332
333333 -- Types available in Network.Google.Prelude.
334334 core = Map.fromList
335− [ ("Body", SLit requiredInfo Body)
335+ [ ("Body", SLit requiredInfo Body)
336+ , ("JSONValue", SLit requiredInfo JSONValue)
336337 ]
337338
338339makeLenses ''Memo
gen/src/Gen/Types/Schema.hs+1
@@ -201,6 +201,7 @@ data Lit
201201 | DateTime
202202 -- Core types.
203203 | Body
204+ | JSONValue
204205 | Alt Text
205206 | Key
206207 | OAuthToken