File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/Servant/Swagger/Internal/TypeLevel Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,13 @@ type AddBodyType c cs a as = If (Elem c cs) (a ': as) as
72
72
73
73
-- | Extract a list of "body" types for a specific content-type from a servant API.
74
74
-- To extract unique types see @'BodyTypes'@.
75
+ --
76
+ -- @'NoContent'@ is removed from the list and not tested. (This allows for leaving the body
77
+ -- completely empty on responses to requests that only accept 'application/json', while
78
+ -- setting the content-type in the response accordingly.)
75
79
type family BodyTypes' c api :: [* ] where
76
80
BodyTypes' c (Verb verb b cs (Headers hdrs a )) = AddBodyType c cs a '[]
81
+ BodyTypes' c (Verb verb b cs NoContent ) = '[]
77
82
BodyTypes' c (Verb verb b cs a ) = AddBodyType c cs a '[]
78
83
BodyTypes' c (ReqBody' mods cs a :> api ) = AddBodyType c cs a (BodyTypes' c api )
79
84
BodyTypes' c (e :> api ) = BodyTypes' c api
You can’t perform that action at this time.
0 commit comments