Created
January 22, 2016 16:42
-
-
Save codedmart/9f36412b683f5b76cad9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Filters = Filters | |
{ logicalOperator :: Text | |
, conditions :: [Condition | Filters] | |
} deriving (Show, Eq, Generic) | |
instance ToJSON Filters where | |
toJSON = genericToJSON $ aesonDrop 0 snakeCase | |
instance FromJSON Filters where | |
parseJSON = genericParseJSON $ aesonDrop 0 snakeCase | |
data Condition = Condition | |
{ path :: Text | |
, relation :: Text | |
, values :: [Value] | |
} deriving (Show, Eq, Generic) | |
instance ToJSON Condition where | |
toJSON = genericToJSON defaultOptions | |
instance FromJSON Condition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment