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

Consider null a valid string #446

Merged
merged 2 commits into from
Apr 7, 2017
Merged

Consider null a valid string #446

merged 2 commits into from
Apr 7, 2017

Conversation

matteofigus
Copy link
Member

Fixes #425

I decided to proceed in the following way:

  1. When a string null parameter gets sent to the request, it gets first parsed for applying default values. Before, it used to apply a default in case of undefined => now it applies default in case of null too.
  2. After applying the default values, if any, there is a sanitisation process. If the string param is still null I sanitise it by converting it to empty string
  3. Validation will be ok in case of empty.

I included some unit tests and also an acceptance that tests that too.

Copy link
Collaborator

@federicomaffei federicomaffei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@federicomaffei federicomaffei merged commit 7d80a11 into master Apr 7, 2017
@matteofigus matteofigus deleted the nullstring branch April 7, 2017 16:45
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

Successfully merging this pull request may close these issues.

2 participants