Skip to content

Commit 2008733

Browse files
Fix superclass conditions on HasOpenApi (UVerb method cs (a ': as))
Unconditionally requesting `ToSchema a` etc means that we erroneously demand `ToSchema NoContent`. Instead delegate to the `HasOpenApi` instance for the related `Verb`, allowing the overlapping instances for `NoContent` to be selected.
1 parent 146d84b commit 2008733

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Unreleased
22
----------
33

4+
* The `HasOpenApi` instance that recurses through `UVerb` responses no
5+
longer demands `ToSchema NoContent`.
46
* Do not count `NoContent` as a body type if it appears in `Headers
57
hdrs NoContent`.
68

src/Servant/OpenApi/Internal.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ instance HasOpenApi (UVerb method cs '[]) where
198198
-- | @since <2.0.1.0>
199199
instance
200200
{-# OVERLAPPABLE #-}
201-
( ToSchema a,
202-
HasStatus a,
203-
AllAccept cs,
204-
OpenApiMethod method,
201+
( HasOpenApi (Verb method (StatusOf a) cs a),
205202
HasOpenApi (UVerb method cs as)
206203
) =>
207204
HasOpenApi (UVerb method cs (a ': as))

0 commit comments

Comments
 (0)