From c330b2b55a84fdb8eead4b4b04bade175c20bdf6 Mon Sep 17 00:00:00 2001 From: Justin Tay <49700559+justin-tay@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:43:51 +0800 Subject: [PATCH] Bump com.networknt:json-schema-validator from 1.4.0 to 1.4.2 --- build.gradle.kts | 2 +- .../test/perf/implementations/NetworkNtImplementation.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8a8ced6..928a868 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { implementation("net.jimblackler.jsonschemafriend:core:0.12.4") - implementation("com.networknt:json-schema-validator:1.4.0") + implementation("com.networknt:json-schema-validator:1.4.2") implementation("com.qindesign:snowy-json:0.16.0") runtimeOnly("org.glassfish:jakarta.json:2.0.0:module") diff --git a/src/main/java/org/creekservice/kafka/test/perf/implementations/NetworkNtImplementation.java b/src/main/java/org/creekservice/kafka/test/perf/implementations/NetworkNtImplementation.java index 06b0d14..3e68f9a 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/implementations/NetworkNtImplementation.java +++ b/src/main/java/org/creekservice/kafka/test/perf/implementations/NetworkNtImplementation.java @@ -32,6 +32,7 @@ import com.networknt.schema.SchemaValidatorsConfig; import com.networknt.schema.SpecVersion; import com.networknt.schema.ValidationMessage; +import com.networknt.schema.regex.JoniRegularExpressionFactory; import java.awt.Color; import java.io.IOException; import java.util.Map; @@ -143,10 +144,12 @@ private void validate(final JsonNode node) { private JsonSchema parseSchema( final String schema, final SchemaSpec spec, final AdditionalSchemas additionalSchemas) { - final SchemaValidatorsConfig config = new SchemaValidatorsConfig(); // By default, the library uses the JDK regular expression implementation which is not ECMA // 262 compliant. This requires the joni dependency - config.setEcma262Validator(true); + final SchemaValidatorsConfig config = + SchemaValidatorsConfig.builder() + .regularExpressionFactory(JoniRegularExpressionFactory.getInstance()) + .build(); return JsonSchemaFactory.getInstance( schemaVersion(spec), builder ->