@@ -12,8 +12,6 @@ import Data.Monoid
1212#endif
1313import Control.Arrow
1414import Data.Aeson
15−import Data.Aeson.Parser (jstring)
16−import Data.Attoparsec.ByteString (parseOnly)
1715import Data.Either
1816import Data.Function (on)
1917import Data.Proxy
@@ -164,11 +162,14 @@ spec = describe "Servant.API.ContentTypes" $ do
164162
165163 describe "eitherDecodeLenient" $ do
166164
165+ -- aeson >= 0.9 decodes top-level strings
166+#if MIN_VERSION_aeson(0,9,0)
167167 it "parses top-level strings" $ do
168168 let toMaybe = either (const Nothing) Just
169169 -- The Left messages differ, so convert to Maybe
170170 property $ \x -> toMaybe (eitherDecodeLenient x)
171− `shouldBe` toMaybe (parseOnly jstring $ cs x)
171+ `shouldBe` (decode x :: Maybe String)
172+#endif
172173
173174
174175data SomeData = SomeData { record1 :: String, record2 :: Int }