santhosh-tekuri/jsonschema

Format Not Validated

Closed this issue · 1 comments

Given this schema.json:

{
    "type": "string",
    "format": "date-time"
}

And this bad.json:

"I am not a date-time"

jv does not complain about the invalid date-time:

$ ./cmd/jv/jv schema.json bad.json
$ echo $?
0

Shouldn't it?

format is treated as annotation in draft-2019 onwards. it needs to be explicitly enabled by compiler.AssertFormat = true.

I just need to add a flag to jv to enable this