Skip to content

Commit

Permalink
revert Element parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dten committed Dec 12, 2023
1 parent 955bc2a commit 3516aa7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Test/WebDriver/Commands/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ newtype Element = Element Text
deriving (Eq, Ord, Show, Read)

instance FromJSON Element where
parseJSON (Object o) =
Element <$> do
e <- o .:? "ELEMENT"
eG <- o .:? "element-6066-11e4-a52e-4f735466cecf"
case e <|> eG of
Just e' -> return e'
Nothing -> throw . BadJSON $ "ELEMENT or element-6066-11e4-a52e-4f735466cecf required"
parseJSON (Object o) = Element <$> (o .: "ELEMENT" <|> o .: "element-6066-11e4-a52e-4f735466cecf")
parseJSON v = typeMismatch "Element" v

instance ToJSON Element where
Expand Down

0 comments on commit 3516aa7

Please sign in to comment.