Skip to content

Commit

Permalink
bug: formats must be validated for draft <2019
Browse files Browse the repository at this point in the history
  • Loading branch information
santhosh-tekuri committed Nov 22, 2022
1 parent ed25199 commit b4ca7e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler.go
Expand Up @@ -634,7 +634,7 @@ func (c *Compiler) compileMap(r *resource, stack []schemaRef, sref schemaRef, re

if format, ok := m["format"]; ok {
s.Format = format.(string)
if c.AssertFormat || r.schema.meta.hasVocab("format-assertion") {
if r.draft.version < 2019 || c.AssertFormat || r.schema.meta.hasVocab("format-assertion") {
s.format, _ = Formats[s.Format]
}
}
Expand Down

0 comments on commit b4ca7e3

Please sign in to comment.