@@ -38,6 +38,7 @@ import Hedgehog
3838import qualified Hedgehog.Gen as Gen
3939import qualified Hedgehog.Range as Range
4040import Servant
41+import Servant.API.Modifiers
4142import Type.Reflection (SomeTypeRep)
4243
4344data State v
@@ -131,20 +132,58 @@ instance
131132 toReifiedEndpoint endpoint (Proxy @endpoint)
132133
133134instance
134− (Typeable requestType, ToReifiedEndpoint endpoint) =>
135− ToReifiedEndpoint (Capture name requestType :> endpoint)
135+ (ToReifiedEndpoint endpoint) =>
136+ ToReifiedEndpoint (Description s :> endpoint)
137+ where
138+ toReifiedEndpoint endpoint _ =
139+ toReifiedEndpoint endpoint (Proxy @endpoint)
140+
141+instance
142+ (ToReifiedEndpoint endpoint) =>
143+ ToReifiedEndpoint (Summary s :> endpoint)
136144 where
137145 toReifiedEndpoint endpoint _ =
138146 toReifiedEndpoint endpoint (Proxy @endpoint)
139− & \(args, result, typeRepMap) -> (typeRep (Proxy @requestType) : args, result, typeRepMap)
140147
141148instance
142149 (Typeable requestType, ToReifiedEndpoint endpoint) =>
143− ToReifiedEndpoint (ReqBody contentTypes requestType :> endpoint)
150+ ToReifiedEndpoint (QueryFlag name :> endpoint)
151+ where
152+ toReifiedEndpoint endpoint _ =
153+ toReifiedEndpoint endpoint (Proxy @endpoint)
154+ & \(args, result, typeRepMap) -> (typeRep (Proxy @Bool) : args, result, typeRepMap)
155+
156+instance
157+ (Typeable (If (FoldRequired mods) paramType (Maybe paramType)), ToReifiedEndpoint endpoint, SBoolI (FoldRequired mods)) =>
158+ ToReifiedEndpoint (QueryParam' mods name paramType :> endpoint)
159+ where
160+ toReifiedEndpoint endpoint _ =
161+ toReifiedEndpoint endpoint (Proxy @endpoint)
162+ & \(args, result, typeRepMap) -> (typeRep (Proxy @(If (FoldRequired mods) paramType (Maybe paramType))) : args, result, typeRepMap)
163+
164+instance
165+ (Typeable (If (FoldRequired mods) headerType (Maybe headerType)), ToReifiedEndpoint endpoint, SBoolI (FoldRequired mods)) =>
166+ ToReifiedEndpoint (Header' mods headerName headerType :> endpoint)
167+ where
168+ toReifiedEndpoint endpoint _ =
169+ toReifiedEndpoint endpoint (Proxy @endpoint)
170+ & \(args, result, typeRepMap) -> (typeRep (Proxy @(If (FoldRequired mods) headerType (Maybe headerType))) : args, result, typeRepMap)
171+
172+instance
173+ (Typeable captureType, ToReifiedEndpoint endpoint) =>
174+ ToReifiedEndpoint (Capture' mods name captureType :> endpoint)
175+ where
176+ toReifiedEndpoint endpoint _ =
177+ toReifiedEndpoint endpoint (Proxy @endpoint)
178+ & \(args, result, typeRepMap) -> (typeRep (Proxy @captureType) : args, result, typeRepMap)
179+
180+instance
181+ (Typeable (If (FoldLenient mods) (Either String requestType) requestType), ToReifiedEndpoint endpoint, SBoolI (FoldLenient mods)) =>
182+ ToReifiedEndpoint (ReqBody' mods contentTypes requestType :> endpoint)
144183 where
145184 toReifiedEndpoint endpoint _ =
146185 toReifiedEndpoint endpoint (Proxy @endpoint)
147− & \(args, result, typeRepMap) -> (typeRep (Proxy @requestType) : args, result, typeRepMap)
186+ & \(args, result, typeRepMap) -> (typeRep (Proxy @(If (FoldLenient mods) (Either String requestType) requestType)) : args, result, typeRepMap)
148187
149188newtype ApiOffset = ApiOffset Int
150189 deriving (Eq, Show)