servant icon indicating copy to clipboard operation
servant copied to clipboard

Lenient combinator infers to "Either String"

Open domenkozar opened this issue 6 years ago • 4 comments

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

Expected according to docs is Either Text.

domenkozar avatar Feb 06 '19 14:02 domenkozar

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

phadej avatar Feb 06 '19 15:02 phadej

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.

mcgizzle avatar Feb 07 '19 17:02 mcgizzle

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 :-)

alpmestan avatar Feb 07 '19 17:02 alpmestan

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

mcgizzle avatar Feb 07 '19 19:02 mcgizzle