I want to validate the json file using schema. How to do that.
{
"Book_information: [{
"BookName": "English",
"ConfigFile": "English.json",
"dependsOn": "Tamil",
"maxPurchase": "1",
"BookInformation": {
"name": "English",
"id": "English-1"
}
}, {
"BookName": "Tamil",
"ConfigFile": "Tamil.json",
"maxPurchase": "3",
"BookInformation": {
"name": "Tamil",
"id": "Tamil-1"
}
}]
}
If you're looking for an online tool then you can try jsonschemalint-online-validator
If you need to validate it using Java code then validate-json-against-schema-in-java should help. It provides a step by step approach, along with sample code for reference.
来源:https://stackoverflow.com/questions/35860456/json-schema-validation-in-java