1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Remove Summaries intermediate object and product Error in semantic.proto

This commit is contained in:
joshvera 2018-05-14 18:35:36 -04:00
parent 6449801b77
commit 0663fa9ac9

View File

@ -59,12 +59,12 @@ data TOCSummary
, summarySpan :: Span
, summaryChangeType :: T.Text
}
| ErrorSummary { error :: T.Text, errorSpan :: Span, errorLanguage :: Maybe Language }
| ErrorSummary { errorText :: T.Text, errorSpan :: Span, errorLanguage :: Maybe Language }
deriving (Generic, Eq, Show)
instance ToJSON TOCSummary where
toJSON TOCSummary{..} = object [ "changeType" .= summaryChangeType, "category" .= summaryCategoryName, "term" .= summaryTermName, "span" .= summarySpan ]
toJSON ErrorSummary{..} = object [ "error" .= error, "span" .= errorSpan, "language" .= errorLanguage ]
toJSON ErrorSummary{..} = object [ "error" .= errorText, "span" .= errorSpan, "language" .= errorLanguage ]
isValidSummary :: TOCSummary -> Bool
isValidSummary ErrorSummary{} = False