Repository: networknt/json-schema-validator (java)

Issue:
OpenAPI Spec 3.0 validation should not require exclusiveMinimum to be a number
As specified in https://spec.openapis.org/oas/3.0/schema/latest.html the field `exclusiveMinimum` is a boolean. But while using the example code in `doc/openapi.md` and changing it to the 3.0 instances, the validation fails with an JsonSchemaException: exclusiveMinimum value is not a number at ExclusiveMinimumValidator.java:45

I used it like this:
```
  JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4,
    builder -> builder.metaSchema(OpenApi30.getInstance())
      .defaultMetaSchemaIri(OpenApi30.getInstance().getIri()));

   jsonSchema =
    factory.getSchema(
      SchemaLocation.of("classpath:" + filePath + "#/components/schemas/" + schemaName));
```
and also tried VersionFlag.V7 and other variants. 

Expected behavior: 
```
 "value": {
    "minimum": 0,
    "exclusiveMinimum": true,
```
should validate just fine, with OpenAPI 3.0 and draft 4.

Note: in OpenAPI 3.1 this is changed to a number. 

Pull request:
Fix exclusiveMinimum and exclusiveMaximum for OpenAPI 3.0
Closes #1114 

Patch:
diff --git a/src/main/java/com/networknt/schema/oas/OpenApi30.java b/src/main/java/com/networknt/schema/oas/OpenApi30.java
index e2bc49e..7c6e4e2 100644
--- a/src/main/java/com/networknt/schema/oas/OpenApi30.java
+++ b/src/main/java/com/networknt/schema/oas/OpenApi30.java
@@ -31,8 +31,6 @@ public class OpenApi30 {
                             ValidatorTypeCode.ENUM,
                             ValidatorTypeCode.MINIMUM,
                             ValidatorTypeCode.MAXIMUM,
-                            ValidatorTypeCode.EXCLUSIVE_MINIMUM,
-                            ValidatorTypeCode.EXCLUSIVE_MAXIMUM,
                             ValidatorTypeCode.MULTIPLE_OF,
                             ValidatorTypeCode.MIN_LENGTH,
                             ValidatorTypeCode.MAX_LENGTH,


Test patch:
diff --git a/src/test/java/com/networknt/schema/oas/OpenApi30Test.java b/src/test/java/com/networknt/schema/oas/OpenApi30Test.java
index 91526ea..449265c 100644
--- a/src/test/java/com/networknt/schema/oas/OpenApi30Test.java
+++ b/src/test/java/com/networknt/schema/oas/OpenApi30Test.java
@@ -16,6 +16,7 @@
 package com.networknt.schema.oas;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.List;
@@ -28,6 +29,7 @@ import com.networknt.schema.DisallowUnknownJsonMetaSchemaFactory;
 import com.networknt.schema.InputFormat;
 import com.networknt.schema.JsonSchema;
 import com.networknt.schema.JsonSchemaFactory;
+import com.networknt.schema.OutputFormat;
 import com.networknt.schema.PathType;
 import com.networknt.schema.SchemaLocation;
 import com.networknt.schema.SchemaValidatorsConfig;
@@ -82,4 +84,40 @@ class OpenApi30Test {
         assertEquals("$.paths['/pet'].post.responses['200'].content['application/json'].schema",
                 schema.getEvaluationPath().toString());
     }
+
+    /**
+     * Exclusive maximum true.
+     */
+    @Test
+    void exclusiveMaximum() {
+        String schemaData = "{\r\n"
+                + "  \"type\": \"number\",\r\n"
+                + "  \"minimum\": 0,\r\n"
+                + "  \"maximum\": 100,\r\n"
+                + "  \"exclusiveMaximum\": true\r\n"
+                + "}\r\n"
+                + "";
+        JsonSchemaFactory factory = JsonSchemaFactory.getInstance(VersionFlag.V7, builder -> builder
+                .metaSchema(OpenApi30.getInstance()).defaultMetaSchemaIri(OpenApi30.getInstance().getIri()));
+        JsonSchema schema = factory.getSchema(schemaData);
+        assertFalse(schema.validate("100", InputFormat.JSON, OutputFormat.BOOLEAN));
+    }
+
+    /**
+     * Exclusive minimum true.
+     */
+    @Test
+    void exclusiveMinimum() {
+        String schemaData = "{\r\n"
+                + "  \"type\": \"number\",\r\n"
+                + "  \"minimum\": 0,\r\n"
+                + "  \"maximum\": 100,\r\n"
+                + "  \"exclusiveMinimum\": true\r\n"
+                + "}\r\n"
+                + "";
+        JsonSchemaFactory factory = JsonSchemaFactory.getInstance(VersionFlag.V7, builder -> builder
+                .metaSchema(OpenApi30.getInstance()).defaultMetaSchemaIri(OpenApi30.getInstance().getIri()));
+        JsonSchema schema = factory.getSchema(schemaData);
+        assertFalse(schema.validate("0", InputFormat.JSON, OutputFormat.BOOLEAN));
+    }
 }