{-# OPTIONS_HADDOCK not-home #-}
module Servant.API.Routes.Internal.Header
( HeaderRep (..)
)
where
import Data.Aeson
import Data.Text
import Data.Typeable
import "this" Servant.API.Routes.Utils
data =
{ HeaderRep -> Text
_hName :: Text
, HeaderRep -> TypeRep
_hType :: TypeRep
}
deriving (Int -> HeaderRep -> ShowS
[HeaderRep] -> ShowS
HeaderRep -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HeaderRep] -> ShowS
$cshowList :: [HeaderRep] -> ShowS
show :: HeaderRep -> String
$cshow :: HeaderRep -> String
showsPrec :: Int -> HeaderRep -> ShowS
$cshowsPrec :: Int -> HeaderRep -> ShowS
Show, HeaderRep -> HeaderRep -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HeaderRep -> HeaderRep -> Bool
$c/= :: HeaderRep -> HeaderRep -> Bool
== :: HeaderRep -> HeaderRep -> Bool
$c== :: HeaderRep -> HeaderRep -> Bool
Eq)
instance ToJSON HeaderRep where
toJSON :: HeaderRep -> Value
toJSON HeaderRep {TypeRep
Text
_hType :: TypeRep
_hName :: Text
_hType :: HeaderRep -> TypeRep
_hName :: HeaderRep -> Text
..} =
[Pair] -> Value
object
[ Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
_hName
, Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= TypeRep -> Value
typeRepToJSON TypeRep
_hType
]