{"action":"created","issue":{"url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/414","labels_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/414/labels{/name}","comments_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/414/comments","events_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/414/events","html_url":"https://github.com/joelittlejohn/jsonschema2pojo/issues/414","id":104307024,"number":414,"title":"Generate classes and fill them with data from JSON","user":{"login":"Kuci","id":2872098,"avatar_url":"https://avatars.githubusercontent.com/u/2872098?v=3","gravatar_id":"","url":"https://api.github.com/users/Kuci","html_url":"https://github.com/Kuci","followers_url":"https://api.github.com/users/Kuci/followers","following_url":"https://api.github.com/users/Kuci/following{/other_user}","gists_url":"https://api.github.com/users/Kuci/gists{/gist_id}","starred_url":"https://api.github.com/users/Kuci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kuci/subscriptions","organizations_url":"https://api.github.com/users/Kuci/orgs","repos_url":"https://api.github.com/users/Kuci/repos","events_url":"https://api.github.com/users/Kuci/events{/privacy}","received_events_url":"https://api.github.com/users/Kuci/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-01T16:39:44Z","updated_at":"2015-09-01T16:41:54Z","closed_at":"2015-09-01T16:41:54Z","body":"Hello, I would like to use this library not only for generating Java classes, but for filling them with data from the JSON too.\r\n\r\nLet's say I have this JSON saved as database.json:\r\n```\r\n[\r\n    {\"firstName\":\"John\", \"lastName\":\"Doe\"},\r\n    {\"firstName\":\"Anna\", \"lastName\":\"Smith\"},\r\n    {\"firstName\":\"Peter\", \"lastName\":\"Jones\"}\r\n]\r\n```\r\nNow, I would like to produce classes Person and Database, where Database holds a field `Person[] persons` which will be initialized, for example, like this:\r\n```\r\nPerson[] persons = new Person[] {\r\n\tnew Person(\"John\", \"Doe\"),\r\n\tnew Person(\"Anna\", \"Smith\"),\r\n\tnew Person(\"Peter\", \"Jones\")\r\n};\r\n```\r\nIs this possible ?"},"comment":{"url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/comments/136787099","html_url":"https://github.com/joelittlejohn/jsonschema2pojo/issues/414#issuecomment-136787099","issue_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/414","id":136787099,"user":{"login":"joelittlejohn","id":686384,"avatar_url":"https://avatars.githubusercontent.com/u/686384?v=3","gravatar_id":"","url":"https://api.github.com/users/joelittlejohn","html_url":"https://github.com/joelittlejohn","followers_url":"https://api.github.com/users/joelittlejohn/followers","following_url":"https://api.github.com/users/joelittlejohn/following{/other_user}","gists_url":"https://api.github.com/users/joelittlejohn/gists{/gist_id}","starred_url":"https://api.github.com/users/joelittlejohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelittlejohn/subscriptions","organizations_url":"https://api.github.com/users/joelittlejohn/orgs","repos_url":"https://api.github.com/users/joelittlejohn/repos","events_url":"https://api.github.com/users/joelittlejohn/events{/privacy}","received_events_url":"https://api.github.com/users/joelittlejohn/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T16:41:54Z","updated_at":"2015-09-01T16:41:54Z","body":"No this isn't possible, this library is designed to be used with a data binding library like Jackson or Gson. Check out [Jackson databind](https://github.com/FasterXML/jackson-databind/) the ObjectMapper class that it provides will do what you need. Once you have generated your types using jsonschema2pojo, you can use the ObjectMapper to create instances from JSON data."}}