on master help sign in
Remove to/from json instances for Volume
7097c09Deni Bertovic
src/Docker/Client/Types.hs−7
@@ -738,13 +738,6 @@ instance FromJSON VolumePermission where
738-- @
738-- @
739newtype Volume = Volume FilePath deriving (Eq, Show)
739newtype Volume = Volume FilePath deriving (Eq, Show)
740
740
741−instance ToJSON Volume where
742− toJSON (Volume fp) = JSON.Object $ HM.insert (T.pack fp) (JSON.Object HM.empty) HM.empty
743−
744−instance FromJSON Volume where
745− parseJSON (JSON.Object o) = return $ Volume $ T.unpack $ head $ HM.keys o
746− parseJSON _ = fail "Volume is not an object"
747−
748instance ToJSON [Volume] where
741instance ToJSON [Volume] where
749 toJSON [] = JSON.Object HM.empty
742 toJSON [] = JSON.Object HM.empty
750 toJSON (v:vs) = JSON.Object $ foldl f HM.empty (v:vs)
743 toJSON (v:vs) = JSON.Object $ foldl f HM.empty (v:vs)