diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index 67952c1ed..8f11fb2b3 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -29,9 +29,10 @@ import Term -- | Render a diff to a string representing its JSON. json :: Renderer a ByteString json diff sources = toLazyByteString . fromEncoding . pairs $ - "rows" .= Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources)) + "rows" .= annotateRows (Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources))) <> "oids" .= (oid <$> sources) <> "paths" .= (path <$> sources) + where annotateRows = fmap unRow instance ToJSON Category where toJSON (Other s) = String $ T.pack s