servant
servant copied to clipboard
[servant-auth] Support for `servant-openapi3`?
Using the official Todo.hs example from servant-openapi3, I get the following error when using the Auth combinator of servant-auth:
Todo.hs:62:15: error:
• No instance for (HasOpenApi
(Auth '[BasicAuth] :> Get '[JSON] [Todo]))
arising from a use of ‘toOpenApi’
• In the first argument of ‘(&)’, namely ‘toOpenApi todoAPI’
In the first argument of ‘(&)’, namely
‘toOpenApi todoAPI & info . title .~ "Todo API"’
In the first argument of ‘(&)’, namely
‘toOpenApi todoAPI & info . title .~ "Todo API"
& info . version .~ "1.0"’
|
62 | todoSwagger = toOpenApi todoAPI
| ^^^^^^^^^^^^^^^^^
Could we have an official support of servant-openapi3 package by providing the instances for HasOpenApi through servant-auth-openapi3? (similar to servant-auth-swagger)
Hi, thank you very much for the request, it will be done. :)
I feel like the best place for this instance is servant-openapi3 and not servant-auth, because that's where the typeclass and all instances currently live. Core servant packages do not have to know about servant-openapi3.