Allow allowedTerms and autoLowLikelihood to be optional configs

This commit is contained in:
Joshua Clayton 2016-06-04 08:11:47 -04:00
parent 9cc640aef7
commit 5c4e0c1ccd

View File

@ -41,8 +41,8 @@ data Matcher = Term Position String | Path Position String | AppOccurrences Int
instance FromJSON LanguageConfiguration where
parseJSON (Y.Object o) = LanguageConfiguration
<$> o .: "name"
<*> o .: "allowedTerms"
<*> o .: "autoLowLikelihood"
<*> o .:? "allowedTerms" .!= []
<*> o .:? "autoLowLikelihood" .!= []
<*> o .:? "aliases" .!= []
parseJSON _ = mzero