Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parameters and Headers should not be added to the generated request if they are undefined #16

Open
ghost opened this issue Mar 1, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 1, 2017

In Servant the QueryParam adds its parameter as a Maybe type because query parameters and headers are optional. However, it seems like the vanilla JS generated code always appends the parameters even if undefined.

I think it's a good idea if the generated JS checks for undefined query parameters and headers and appropriately omits them from the URL.

@ghost
Copy link
Author

ghost commented Mar 1, 2017

It's probably a good idea to still send null values though, because we may want to tell the difference between null and undefined, in other words I might parse null as Just Nothing :: Maybe (Maybe a) to distinguish the two.

@ghost
Copy link
Author

ghost commented Mar 1, 2017

I will try to make a pull request...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants