-
Notifications
You must be signed in to change notification settings - Fork 44
Description
code part:
val path="C:\projects\test\Training_2\person.txt".trim
val fileContents = scala.io.Source.fromFile(path).getLines.mkString
//Json.parse(fileContents)
val x= SchemaConverter.convertContent(fileContents)
Exception in thread "main" java.lang.IllegalArgumentException: No in schema at </>
at org.zalando.spark.jsonschema.SchemaConverter$.getJsonType(SchemaConverter.scala:114)
at org.zalando.spark.jsonschema.SchemaConverter$.convert(SchemaConverter.scala:67)
at org.zalando.spark.jsonschema.SchemaConverter$.convertContent(SchemaConverter.scala:60)
input json is : {
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"tradeStatic": {
"description": "Front Cache HDFS Trade Static Schema",
"type": "object",
"properties": {
"tradeStatic": {
"title": "tradeStatic",
"type": "object",
"properties": {
"acquireDate": {
"type": "string",
"pattern": "dd-MM-yyyy",
"format": "date-time"
},
"acquirerName": {
"type": "string"
},
"acquirerNumber": {
"type": "string"
}
},
"required": [
"acquirerName",
"acquirerNumber"
],
"additionalProperties": false
}
},
"required": [
"tradeStatic"
],
"additionalProperties": false
}
}
}