Skip to content

Commit 24e631c

Browse files
committed
Update json-schema-validator API use
Signed-off-by: Michael Mior <mmior@mail.rit.edu>
1 parent 187bf4f commit 24e631c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/scala/io/github/dataunitylab/jsonoid/discovery/DiscoverSchemaSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package schemas
33

44
import scala.io.Source
55

6-
import com.networknt.schema.{JsonSchemaFactory, SpecVersion}
6+
import com.networknt.schema.{SchemaRegistry, SpecificationVersion}
77
import org.json4s._
88
import org.json4s.jackson.JsonMethods._
99
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
@@ -111,9 +111,9 @@ class DiscoverSchemaSpec extends UnitSpec with ScalaCheckPropertyChecks {
111111
)
112112

113113
// XXX This validation is not perfect, but we'll check later with AJV
114-
val factory =
115-
JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012)
116-
val jsonSchema = factory.getSchema(asJsonNode(schema.toJson()))
114+
val schemaRegistry =
115+
SchemaRegistry.withDefaultDialect(SpecificationVersion.DRAFT_2020_12)
116+
val jsonSchema = schemaRegistry.getSchema(asJsonNode(schema.toJson()))
117117
val errors = jsonSchema.validate(asJsonNode(firstDoc))
118118
errors shouldBe empty
119119
}

0 commit comments

Comments
 (0)