如何在Java中将示例JSON转换为JSON模式

我想将json文档转换为json模式。 我用谷歌搜索,但根据我的要求没有得到确切的想法。

这是JSON

{ "empId":1001, "firstName":"jonh", "lastName":"Springer", "title": "Engineer", "address": { "city": "Mumbai", "street": "FadkeStreet", "zipCode":"420125", "privatePhoneNo":{ "privateMobile": "2564875421", "privateLandLine":"251201546" } }, "salary": 150000, "department":{ "departmentId": 10521, "departmentName": "IT", "companyPhoneNo":{ "cMobile": "8655340546", "cLandLine": "10251215465" }, "location":{ "name": "mulund", "locationId": 14500 } } } 

我想生成这样的

  { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "Employee", "properties": { "empId": { "type": "integer" }, "firstName":{ "type":"string" }, "lastName": { "type": "string" }, "title": { "type": "string" }, "address": { "type": "object", "properties": { "city": { "type": "string" }, "street": { "type": "string" }, "zipCode": { "type": "string" }, "privatePhoneNo": { "type": "object", "properties": { "privateMobile": { "type": "string" }, "privateLandLine": { "type": "string" } } } } }, "salary": { "type": "number" }, "department": { "type": "object", "properties": { "departmentId": { "type": "integer" }, "departmentName": { "type": "string" }, "companyPhoneNo": { "type": "object", "properties": { "cMobile": { "type": "string" }, "cLandLine": { "type": "string" } } }, "location": { "type": "object", "properties": { "name": { "type": "string" }, "locationId": { "type": "integer" } } } } } } } 

是否有任何图书馆正在这样做或者另一种方式是什么?