Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No headers bodytype #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
-------

Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/Servant/OpenApi/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/Servant/OpenApi/Internal/TypeLevel/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down