diff --git a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java index 32eeb3b23..0f0adee32 100644 --- a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java +++ b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java @@ -19,6 +19,7 @@ import javax.json.JsonReader; import javax.json.JsonReaderFactory; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -68,8 +69,10 @@ public Config getConfig() { * @param stream the InputStream for the schema. * @return the read schema. */ - protected JsonSchema readSchema(InputStream stream) { - try (JsonSchemaReader reader = schemaReaderFactory.createSchemaReader(stream)) { + protected JsonSchema readSchema(InputStream stream) throws Exception{ + byte[] bytes = stream.readAllBytes(); + InputStream jsonStream = new ByteArrayInputStream(bytes); + try (JsonSchemaReader reader = schemaReaderFactory.createSchemaReader(jsonStream)) { return reader.read(); } }