From 0dbf63c6a92599cba5b92e0ceea24d66a5986e18 Mon Sep 17 00:00:00 2001 From: Dmitry Olshansky Date: Wed, 14 Aug 2024 13:45:24 +0300 Subject: [PATCH] Add instance HasOpenApi (EmptyAPI :> api) --- src/Servant/OpenApi/Internal.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Servant/OpenApi/Internal.hs b/src/Servant/OpenApi/Internal.hs index 7551058..92f6912 100644 --- a/src/Servant/OpenApi/Internal.hs +++ b/src/Servant/OpenApi/Internal.hs @@ -86,6 +86,10 @@ instance HasOpenApi Raw where instance HasOpenApi EmptyAPI where toOpenApi _ = mempty +-- | Ignore @'EmptyAPI'@ as part of route in server handlers. +instance HasOpenApi api => HasOpenApi (EmptyAPI :> api) where + toOpenApi _ = toOpenApi (Proxy @api) + -- | All operations of sub API. -- This is similar to @'operationsOf'@ but ensures that operations -- indeed belong to the API at compile time.