Commit 17e8454e authored by Alexandre Delanoë's avatar Alexandre Delanoë

[PHYLO] Api backend render svg properly now (without escaping).

parent ff53e1bb
...@@ -23,9 +23,10 @@ Portability : POSIX ...@@ -23,9 +23,10 @@ Portability : POSIX
module Gargantext.Viz.Phylo.API module Gargantext.Viz.Phylo.API
where where
import Data.String.Conversions
--import Control.Monad.Reader (ask) --import Control.Monad.Reader (ask)
import qualified Data.ByteString as DB import qualified Data.ByteString as DB
import qualified Data.ByteString.Lazy.Char8 as DBL (pack) import qualified Data.ByteString.Lazy as DBL
import Data.Text (Text) import Data.Text (Text)
import Data.Map (empty) import Data.Map (empty)
import Data.Swagger import Data.Swagger
...@@ -63,7 +64,10 @@ newtype SVG = SVG DB.ByteString ...@@ -63,7 +64,10 @@ newtype SVG = SVG DB.ByteString
instance ToSchema SVG instance ToSchema SVG
where where
declareNamedSchema = undefined declareNamedSchema = undefined {-genericDeclareNamedSchema
defaultSchemaOptions {fieldLabelModifier = \fieldLabel -> drop 3 fieldLabel}
-}
-- undefined
--genericDeclareNamedSchemaUnrestricted (swaggerOptions "") --genericDeclareNamedSchemaUnrestricted (swaggerOptions "")
instance Show SVG where instance Show SVG where
...@@ -75,8 +79,9 @@ instance Accept SVG where ...@@ -75,8 +79,9 @@ instance Accept SVG where
instance Show a => MimeRender PlainText a where instance Show a => MimeRender PlainText a where
mimeRender _ val = cs ("" <> show val) mimeRender _ val = cs ("" <> show val)
instance Show a => MimeRender SVG a where instance MimeRender SVG SVG where
mimeRender _ val = DBL.pack $ ("SVG" <> show val) mimeRender _ (SVG s) = DBL.fromStrict s
------------------------------------------------------------------------ ------------------------------------------------------------------------
type GetPhylo = QueryParam "listId" ListId type GetPhylo = QueryParam "listId" ListId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment