{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE UndecidableInstances #-}

-- | This module exports orphan instances to make
-- [@servant-openapi3@](https://hackage.haskell.org/package/servant-openapi3) work with [@servant-queryparam-core@](https://hackage.haskell.org/package/servant-queryparam-core).
module Servant.OpenApi.Record () where

import Data.OpenApi
import Data.Proxy
import Servant.API
import Servant.OpenApi
import Servant.Record

instance HasOpenApi (UnRecordParam mod (RecordParam mod a :> api)) => HasOpenApi (RecordParam mod a :> api) where
  toOpenApi :: Proxy (RecordParam mod a :> api) -> OpenApi
  toOpenApi _ = toOpenApi (Proxy :: Proxy (UnRecordParam mod (RecordParam mod a :> api)))
