diff --git a/pom.xml b/pom.xml
index f2a692f00..fa16f3ccf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,6 +48,10 @@
OpenBankProject Git based repo
https://raw.githubusercontent.com/OpenBankProject/OBP-M2-REPO/master/
+
+ jitpack.io
+ https://jitpack.io
+
@@ -59,6 +63,11 @@
+
+ com.github.everit-org.json-schema
+ org.everit.json.schema
+ 1.6.1
+
ch.qos.logback
logback-classic
diff --git a/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala b/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala
index 090f3a5f9..3aa4fccbf 100644
--- a/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala
+++ b/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala
@@ -2053,7 +2053,7 @@ object SwaggerDefinitionsJSON {
name = "String",
version = "String",
git_commit = "String",
- date = "String"
+ date = "2013-01-21T23:08:00Z"
)
val thisAccountJsonV300 = ThisAccountJsonV300(
diff --git a/src/test/scala/code/api/v1_4_0/JSONFactory1_4_0Test.scala b/src/test/scala/code/api/v1_4_0/JSONFactory1_4_0Test.scala
index 46f215a92..0966ecbec 100644
--- a/src/test/scala/code/api/v1_4_0/JSONFactory1_4_0Test.scala
+++ b/src/test/scala/code/api/v1_4_0/JSONFactory1_4_0Test.scala
@@ -2,22 +2,18 @@ package code.api.v1_4_0
import java.util.Date
-import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON
import code.api.util.APIUtil
-import code.api.util.APIUtil.{ApiVersion, ResourceDoc}
+import code.api.util.APIUtil.ResourceDoc
import code.api.v1_4_0.JSONFactory1_4_0.ResourceDocJson
-import code.api.v2_1_0.OBPAPI2_1_0
-import code.api.v2_2_0.OBPAPI2_2_0
import code.api.v3_0_0.OBPAPI3_0_0
import code.util.Helper.MdcLoggable
-import net.liftweb.json.Extraction
import net.liftweb.json.Extraction.decompose
+import net.liftweb.json._
+import org.everit.json.schema.loader.SchemaLoader
+import org.json.JSONObject
import org.scalatest._
-import scala.collection.mutable.ArrayBuffer
-import net.liftweb.json._
-
-import scala.collection.mutable
+import scala.collection.mutable;
case class OneClass(
string : String = "String",
@@ -73,4 +69,21 @@ class JSONFactory1_4_0Test extends FlatSpec
logger.debug(prettyRender(result))
}
+
+ "validate all the resouceDocs json schema " should "work well, no exception is good enough" in {
+ val resourceDocsRaw= OBPAPI3_0_0.allResourceDocs
+ val resouceDocs = JSONFactory1_4_0.createResourceDocsJson(resourceDocsRaw.toList)
+
+ for{
+ resouceDoc <- resouceDocs.resource_docs
+ json <- List(compactRender(decompose(resouceDoc.success_response_body)))
+ jsonSchema <- List(compactRender(resouceDoc.typed_success_response_body))
+ } yield {
+ val rawSchema = new JSONObject(jsonSchema)
+ val schema = SchemaLoader.load(rawSchema)
+ schema.validate(new JSONObject(json))
+ }
+
+ }
+
}