haskell-servant / haskell-servant/servant

Optional ReqBody does not wrap it’s type into Maybe

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

Description

Here is a minimal reproducible demo that shows the problem: https://gist.github.com/unclechu/347bbc386e0659242de80e8ff38b0ec6 (requires [Nix](https://nixos.org/download.html#nix-quick-install) to run). This demo also shows a trick how to overcome the problem.

Even when I define `ReqBody` with `Optional` mod:
``` haskell
ReqBody' '[Optional, Strict] '[JSON] SomeType
```

In the `Server` type `SomeType` stays the same, without `Maybe` wrap that I would also expect from `QueryParam` for instance.

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.