haskell-servant / servant

Servant is a Haskell DSL for describing, serving, querying, mocking, documenting web applications and more!
https://docs.servant.dev/
1.83k stars 413 forks source link

Lenient combinator infers to "Either String" #1118

Open domenkozar opened 5 years ago

domenkozar commented 5 years ago

Using ReqBody' '[Required, Lenient] '[JSON] Events

Expected according to docs is Either Text.

phadej commented 5 years ago

It's indeed an inconsistency. one need to modify HasServer (ReqBody ' ...) instance

mcgizzle commented 5 years ago

Hey I'm a heavy user of Servant and would like to get involved in its development.

I think this might be a good first issue? But might need some extra info on what needs to be done before I can start hacking.

alpmestan commented 5 years ago

Hello @McGizzle! This indeed should be a great first issue, the patch for this is quite trivial.

All we need is to change Either String to Either Text in https://github.com/haskell-servant/servant/blob/master/servant-server/src/Servant/Server/Internal.hs#L581, and adapt whatever breaks because of this :-)

mcgizzle commented 5 years ago

Great! I should have some spare time at the weekend so will do that and make a PR :)