haskell-servant / haskell-servant/servant

[servant-auth] Support for `servant-openapi3`?

Open
#1,505 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
2k
Forks
427
Avg merge
2d 23h
Merged PRs (30d)
5

Description

Using the official [`Todo.hs`](https://github.com/biocad/servant-openapi3/blob/master/example/src/Todo.hs) example from `servant-openapi3`, I get the following error when using the `Auth` combinator of `servant-auth`:

```haskell
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`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.