servant-swagger
servant-swagger copied to clipboard
validateEveryToJSON ignores new response handlers
We’ve implemented a new handler (for streaming responses) by providing instances of HasServer
, HasClient
, Accept
, and HasSwagger
. This works reasonably well, but now we've run into an issue where the type-level machinery used by validateEveryToJSON
(i.e. BodyTypes
) can’t be extended in a similar way, and in fact it silently ignores endpoints that use the new type. I don’t know if this approach can be made to handle this, but it would be an improvement if it at least gave an error saying that it can’t discover all the types.
The problem is the “default” case on this line: https://github.com/haskell-servant/servant-swagger/blob/735657be74c1fb701c18d6eeac4d3b2ba23b66e1/src/Servant/Swagger/Internal/TypeLevel/API.hs#L81
@fizruk should we make it extendable similarly as IsElem
for safeLink
is?
@phadej definitely!
Hi, Servant-swagger will be moved into the main Servant repo (see : https://github.com/haskell-servant/servant/pull/1475) If this issue is still relevant, would it be possible for you to summit it there? : https://github.com/haskell-servant/servant/issues
Thanks in advance!