From 5128c855921f29f3b4f253b035461f76b2b2b8b0 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Sun, 29 May 2022 18:14:10 -0500 Subject: Make description optional --- src/Tomato/Data/Tomato.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Tomato') diff --git a/src/Tomato/Data/Tomato.hs b/src/Tomato/Data/Tomato.hs index 4b75adf..e74f965 100644 --- a/src/Tomato/Data/Tomato.hs +++ b/src/Tomato/Data/Tomato.hs @@ -6,7 +6,7 @@ module Tomato.Data.Tomato import RIO -import Data.Aeson ((.:)) +import Data.Aeson ((.:), (.:!)) import Network.HTTP.Req (Url, Scheme (Https), useHttpsURI) import qualified Data.Aeson as Ae @@ -20,7 +20,7 @@ data Tomato = Tomato , height :: !Word , color :: !Text , blur_hash :: !Text - , description :: !Text + , description :: !(Maybe Text) , urls :: !Urls , links :: !Links } deriving Show @@ -32,7 +32,7 @@ instance Ae.FromJSON Tomato where <*> o .: "height" <*> o .: "color" <*> o .: "blur_hash" - <*> o .: "description" + <*> o .:! "description" <*> o .: "urls" <*> o .: "links" -- cgit v1.2.3