fizruk / http-api-data

Converting to/from HTTP API data like URL pieces, headers and query parameters.
http://hackage.haskell.org/package/http-api-data
Other
52 stars 42 forks source link

could not parse: `' (input does not start with a digit) #96

Closed picca closed 5 years ago

picca commented 5 years ago

Hello, I try to use a webform with a Maybe Float

but I get this error message when it tries to parse the parameter resolution.

here the request from servant

Oct 15 11:33:38 process2 autoprocessing-exe[171261]: POST /xdsme
Oct 15 11:33:38 process2 autoprocessing-exe[171261]:   Params: [("dataCollectionId","0"),("resolution",""),("optimize","0"),("celll",""),("spacegroup","")]
Oct 15 11:33:38 process2 autoprocessing-exe[171261]:   Request Body: dataCollectionId=0&resolution=&optimize=0&celll=&spacegroup=
Oct 15 11:33:38 process2 autoprocessing-exe[171261]:   Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Oct 15 11:33:38 process2 autoprocessing-exe[171261]:   Status: 400 Bad Request 0.0003s
could not parse: `' (input does not start with a digit)

Indeed "" is not a float, but in that case I expect Nothing.

So where is the problem ?

phadej commented 5 years ago

Won't fix.

In servant: