-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
FormatChecker not working on 'email' #336
Comments
You forgot "properties": "tags".
…On May 24, 2017 19:09, "Paul" ***@***.***> wrote:
I'm sure I'm likely doing something wrong.
This code works fine:
***@***.***",
{ "format" : "email"},
format_checker=jsonschema.FormatChecker())
But when I define a schema like this:
{
"type" : "object",
"tags" : {
"email" : {
"type" : "string",
"format" : "email"
}
}
}
and load it in from a file and use it to validate a file like this:
{
"tags" : {
"email": "noreply",
}
}
using this code:
jsonschema.validate(config,
schema,
format_checker=jsonschema.FormatChecker())
It passes. Despite the tags["email"] value not being a valid email format.
What am I doing wrong?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#336>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUIXriLRRm_77Ww0VZyus9te3LVkLMPks5r9LiWgaJpZM4Nlxki>
.
|
Doh! I knew I was doing something wrong :) Thanks. Should a format of email pass on a string like |
@pll have a look at jsonschema._format which simply looks for the presence of the |
Thanks! |
I'm sure I'm likely doing something wrong.
This code works fine:
But when I define a schema like this:
and load it in from a file and use it to validate a file like this:
using this code:
It passes. Despite the
tags["email"]
value not being a valid email format.What am I doing wrong?
Thanks!
The text was updated successfully, but these errors were encountered: