@@ -1187,6 +1187,7 @@ instance FromJSON Word64 where
11871187instance FromJSONKey Word64 where
11881188 fromJSONKey = FromJSONKeyTextParser parseIntegralText
11891189
1190+
11901191instance FromJSON Text where
11911192 parseJSON = withText "Text" pure
11921193 {-# INLINE parseJSON #-}
@@ -1194,17 +1195,28 @@ instance FromJSON Text where
11941195instance FromJSONKey Text where
11951196 fromJSONKey = fromJSONKeyCoerce
11961197
1198+
11971199instance FromJSON LT.Text where
11981200 parseJSON = withText "Lazy Text" $ pure . LT.fromStrict
11991201 {-# INLINE parseJSON #-}
12001202
1203+instance FromJSONKey LT.Text where
1204+ fromJSONKey = FromJSONKeyText LT.fromStrict
1205+
1206+
12011207instance FromJSON Version where
1208+ parseJSON = withText "Version" parseVersionText
12021209 {-# INLINE parseJSON #-}
1203− parseJSON = withText "Version" $ go . readP_to_S parseVersion . unpack
1204− where
1205− go [(v,[])] = return v
1206− go (_ : xs) = go xs
1207− go _ = fail $ "could not parse Version"
1210+
1211+instance FromJSONKey Version where
1212+ fromJSONKey = FromJSONKeyTextParser parseVersionText
1213+
1214+parseVersionText :: Text -> Parser Version
1215+parseVersionText = go . readP_to_S parseVersion . unpack
1216+ where
1217+ go [(v,[])] = return v
1218+ go (_ : xs) = go xs
1219+ go _ = fail $ "could not parse Version"
12081220
12091221-------------------------------------------------------------------------------
12101222-- semigroups NonEmpty