{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-orphans #-} import Data.Aeson import Data.Aeson.Encode.Pretty (encodePretty) import Data.Proxy import Data.String.Conversions import Data.Text (Text) import GHC.Generics import Servant.API import Servant.API.ContentTypes import Servant.Docs -- * Example -- | A greet message data type newtype Greet = Greet Text deriving (Generic, Show) instance FromJSON Greet instance ToJSON Greet instance MimeRender JSON Greet where toByteString Proxy = encodePretty instance MimeRender HTML Greet where toByteString Proxy (Greet s) = "