0

Here is my json schema

[
 {
  "title": "Taman Lansia",
  "alamat": "Jl. Cisangkuy, Citarum, Bandung Wetan, Kota Bandung, Jawa Barat 40123",
  "image": "Link image",
  "status": 1
 },
 {
  "title": "Fasilitas Taman_Lansia",
  "fasilitas": [
    {
     "namaFasilitas": "Area Piknik",
     "imageFasilitas": "Link Image"
    },
    {
     "namaFasilitas": "Jalur Jogging",
     "imageFasilitas": "Link Image"
    }
   ],
   "status": 2
 }
]

How to resolve this, because i'm just trying in http://jsonschema2pojo.org and then no result or no response. Thank you

  • thats no real json schema as you can see on your linked website they want s.t like { "type":"object", "properties": { "foo": { "type": "string" }, "bar": { "type": "integer" }, "baz": { "type": "boolean" } } } – RichieK Jan 21 '19 at 17:15

1 Answers1

0

Well you POJO obviously has to have every possible attribute you have in your schema and then just have the other values not set as null...

So

public class MyObject {
    private String title;
    private List<OtherObject> fasilitas;
...

}
RichieK
  • 474
  • 6
  • 15