Count API part of Gargantext.
-}
-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE DataKinds #-}
+
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
-{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
-{-# LANGUAGE OverloadedStrings #-}
module Gargantext.API.Count
where
import GHC.Generics (Generic)
-import Prelude (Bounded, Enum, minBound, maxBound)
import Data.Aeson hiding (Error)
import Data.Aeson.TH (deriveJSON)
-import Data.Eq (Eq())
import Data.Either
-import Data.List (repeat, permutations)
+import Data.List (permutations)
import Data.Swagger
import Data.Text (Text, pack)
-- import Control.Applicative ((<*>))
import Gargantext.Prelude
-import Gargantext.Core.Utils.Prefix (unPrefix)
+import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
-----------------------------------------------------------------------
-- TODO-ACCESS: CanCount
, n <- take 10 $ permutations scrapers
]
-instance ToSchema Query
+instance ToSchema Query where
+ declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "query_")
+
-----------------------------------------------------------------------
type Code = Integer
type Error = Text
$(deriveJSON (unPrefix "count_") ''Count)
-instance ToSchema Count
+instance ToSchema Count where
+ declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "count_")
--instance Arbitrary Count where
-- arbitrary = Count <$> arbitrary <*> arbitrary <*> arbitrary