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

At least warn if you try to serialize a Boolean in a form body #117

Open
jnthn opened this issue Nov 11, 2020 · 0 comments
Open

At least warn if you try to serialize a Boolean in a form body #117

jnthn opened this issue Nov 11, 2020 · 0 comments

Comments

@jnthn
Copy link
Member

jnthn commented Nov 11, 2020

I just helped track down why a test looking like this failed:

        test-given '/get_excel_export', {
            test post(
                content-type => 'application/x-www-form-urlencoded',
                body => {
                    :datasetName('TestSingle'),
                    :language('de'),
                    :!withFilters
                }),
                status => 200;
        };

A urlencoded form cannot represent a boolean. It has no concept of anything but strings, really. A checkbox will not submit a boolean, but rather a value string or an empty string. We can certainly automatically stringify numbers as a convenience, but probably anything that's neither a string nor a number (excluding Bool) is probably not going to do anything useful. We should warn about this situation.

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

1 participant