{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}
module Servant.OpenApi.Internal.Orphans where

import Data.OpenApi
import Data.Proxy            (Proxy (..))
import Data.Typeable         (Typeable)
import Servant.Types.SourceT (SourceT)

-- | Pretend that 'SourceT m a' is '[a]'.
--
-- @since 1.1.7
--
instance (Typeable (SourceT m a), ToSchema a) => ToSchema (SourceT m a) where
    declareNamedSchema :: Proxy (SourceT m a) -> Declare (Definitions Schema) NamedSchema
declareNamedSchema Proxy (SourceT m a)
_ = Proxy [a] -> Declare (Definitions Schema) NamedSchema
forall a.
ToSchema a =>
Proxy a -> Declare (Definitions Schema) NamedSchema
declareNamedSchema (Proxy [a]
forall k (t :: k). Proxy t
Proxy :: Proxy [a])