@@ -631,9 +631,19 @@ class RecJsonParse (lts :: [*]) where
631631instance RecJsonParse '[] where
632632 recJsonParse _ initSize _ = pure (ForallST (unsafeRNil initSize))
633633
634+class FromJSON a => ParseField a where
635+ parseField :: Object -> T.Text -> Parser a
636+
637+instance FromJSON a => ParseField a where
638+ parseField = (.:)
639+
640+instance {-# OVERLAPS #-} FromJSON a => ParseField (Maybe a) where
641+ parseField = (.:?)
642+
634643instance
635644 ( KnownSymbol l,
636645 FromJSON t,
646+ ParseField t,
637647 RecJsonParse lts,
638648 RecSize lts ~ s,
639649 KnownNat s,
@@ -645,7 +655,7 @@ instance
645655 let lbl :: FldProxy l
646656 lbl = FldProxy
647657 rest <- recJsonParse options initSize obj
648− (v :: t) <- obj .: T.pack (fieldTransform options (symbolVal lbl))
658+ (v :: t) <- obj `parseField` T.pack (fieldTransform options (symbolVal lbl))
649659 pure $ ForallST (unsafeRCons (lbl := v) =<< unForallST rest)
650660
651661-- | Machinery for NFData