-
Notifications
You must be signed in to change notification settings - Fork 4
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
Validation of datetimes #22
Comments
Currently the schema only ensures values you set are correct. It doesn't ensure values without defaults are provided. It wouldn't take much to convince me that it ought enforce that. |
In this particular instance we want to make sure that every one of these items is present with the exception of the I guess our need is some way to make sure that all fields we wanted to be present are actually there, and we have the notion of an optional field, like the modification date field that may be missing but has to be a DateTime if it's there. If someone supplies a |
So I'm experimenting with adding this, and my tests [oh wow, I have tests, don't I? :) ] show my original intention was that the error would raise if you accessed a no-default attribute without a value. This is conflicting with the new approach. From memory, I wanted the schema to act stand-alone, so you could instantiate a schema derivative, and then set its values. I'm not sure of how much utility this still is. |
We currently have a
BlogPost
class that looks like this:We want to make sure a
posted
item (the post date) contains a proper datetime.The following contains no
posted
however it seems to pass through the validation with no issues:Is there something we are getting wrong in our
BlogPost
definition here?The text was updated successfully, but these errors were encountered: