-
Notifications
You must be signed in to change notification settings - Fork 145
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
Invalid Schema of String and Boolean #355
Comments
Yes I'm facing same Issue |
Hey folks, type coercion is a feature of colander, not a bug. This is common with many (de)serialization frameworks - they are not directly responsible for validation. You can think of colander more similarly to Colander can be extended to support more strict type validation for certain use-cases but it is not builtin to the default types. One example that could be built upon is you'll notice that I have no plans to work on this feature myself, but would try to find time to consider any contributions and review them. |
Currently, there is an issue with the string and boolean schema in Colander. The schema does not handle invalid values correctly and leads to unexpected behaviour.
When a string or boolean value is passed to the schema, it should only accept valid values that match the specified format or type. However, the current implementation allows invalid values to be accepted without any warnings or error messages. This can cause issues when processing the data later on, as the data may not be in the expected format.
For example, if a boolean schema is defined to only accept "true" or "false" values, but an invalid value such as "1" or "yes" is passed to the schema, the schema should raise an error. However, the current implementation accepts these invalid values without raising any errors, which can lead to unexpected behaviour in the code.
And if String schema is defined, it accepts all the data types at the time of serialisation and converts them to a string which shouldn't happen while validating.
This issue can be problematic for developers who rely on Colander for data validation, as it can lead to data integrity issues and difficult-to-debug errors. It is important to ensure that the schema correctly handles invalid values and raises appropriate error messages to alert developers to potential issues.
Overall, the issue with invalid string and boolean schema in Colander needs to be addressed to ensure that the schema is reliable and can be trusted for data validation.
The text was updated successfully, but these errors were encountered: