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:
parent
6449801b77
commit
0663fa9ac9
@ -59,12 +59,12 @@ data TOCSummary
|
|||||||
, summarySpan :: Span
|
, summarySpan :: Span
|
||||||
, summaryChangeType :: T.Text
|
, 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)
|
deriving (Generic, Eq, Show)
|
||||||
|
|
||||||
instance ToJSON TOCSummary where
|
instance ToJSON TOCSummary where
|
||||||
toJSON TOCSummary{..} = object [ "changeType" .= summaryChangeType, "category" .= summaryCategoryName, "term" .= summaryTermName, "span" .= summarySpan ]
|
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 :: TOCSummary -> Bool
|
||||||
isValidSummary ErrorSummary{} = False
|
isValidSummary ErrorSummary{} = False
|
||||||
|
Loading…
Reference in New Issue
Block a user