-
Notifications
You must be signed in to change notification settings - Fork 191
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
[FIX] Schema validation for empty string defaults #1100
Conversation
I'm a bit lost to what this code is doing. Why would you ever set a default string of If it's related to initialising blank params, #992 may be related (everything should be initialised as |
I agree but if you want to completely forbid this, the function should return an error instead of an object that does not fit to the general return type of the function. |
Or is the empty string considered to be the return type for "Failed"? |
Yup I completely agree, it definitely sounds like a bug as it stands. I was just thinking that a better fix would be to remove this code completely as part of the bigger issue. I was curious if you were deliberately setting default values like these for a reason that I hadn't thought of. |
I see! No not really, I think they were leftovers because we did not know back then that null was possible as a value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming back to this, I agree with the PR. This code is for fetching the values, so it's too early to be making decisions about whether those values are valid or not. That will happen later in the linting code.
sanitise_param_default should probably always return a dict. I tried adding a test but I think adding a full extensive test schema would be better. The template that is tested, is not very complex.