haskell-servant / haskell-servant/servant-js

Generated vanilla code does not properly handle arrays (QueryParams)

Open
#17 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
23
Forks
22
PR merge metrics
No merged PRs in 30d

Description

It seems like the generated code builds arrays like so `?myParam=var1,var2,var3` which is not properly parsed by most servers, and in fact as far as I can tell this format is not even handled by Servant's own `QueryParams`.

The correctly generated javascript should look like: `?myParam=var1&myParam=var2&myParam=var3` and this list should itself be generated in javascript, at runtime, because it depends on the array parameter passed into the function.

Some servers also accept `?myParam[]=var1&myParam[]=var2&myParam[]=var3`, but not all.

It doesn't seem like anybody has really tried using this generated JS code...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.