diff --git a/CHANGELOG.md b/CHANGELOG.md index 2499585..212f352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Unreleased +---------- + +* The `HasOpenApi` instance that recurses through `UVerb` responses no + longer demands `ToSchema NoContent`. +* Do not count `NoContent` as a body type if it appears in `Headers + hdrs NoContent`. + 1.1.8 ------- @@ -14,7 +22,7 @@ * Support servant-0.15 - support for 'Stream' and 'StreamBody' combinators - orphan 'ToSchema (SourceT m a)' instance -* Fix BodyTypes to work with generalized ReqBody' +* Fix BodyTypes to work with generalized ReqBody' [#88](https://github.com/haskell-servant/servant-swagger/pull/88) 1.1.6 diff --git a/src/Servant/OpenApi/Internal.hs b/src/Servant/OpenApi/Internal.hs index 7551058..ce21e8a 100644 --- a/src/Servant/OpenApi/Internal.hs +++ b/src/Servant/OpenApi/Internal.hs @@ -198,10 +198,7 @@ instance HasOpenApi (UVerb method cs '[]) where -- | @since <2.0.1.0> instance {-# OVERLAPPABLE #-} - ( ToSchema a, - HasStatus a, - AllAccept cs, - OpenApiMethod method, + ( HasOpenApi (Verb method (StatusOf a) cs a), HasOpenApi (UVerb method cs as) ) => HasOpenApi (UVerb method cs (a ': as)) diff --git a/src/Servant/OpenApi/Internal/TypeLevel/API.hs b/src/Servant/OpenApi/Internal/TypeLevel/API.hs index 41feeba..5f10cf5 100644 --- a/src/Servant/OpenApi/Internal/TypeLevel/API.hs +++ b/src/Servant/OpenApi/Internal/TypeLevel/API.hs @@ -86,7 +86,7 @@ type AddBodyType c cs a as = If (Elem c cs) (a ': as) as -- completely empty on responses to requests that only accept 'application/json', while -- setting the content-type in the response accordingly.) type family BodyTypes' c api :: [*] where - BodyTypes' c (Verb verb b cs (Headers hdrs a)) = AddBodyType c cs a '[] + BodyTypes' c (Verb verb b cs (Headers hdrs a)) = BodyTypes' c (Verb verb b cs a) BodyTypes' c (Verb verb b cs NoContent) = '[] BodyTypes' c (Verb verb b cs a) = AddBodyType c cs a '[] BodyTypes' c (ReqBody' mods cs a :> api) = AddBodyType c cs a (BodyTypes' c api)