Search code examples
javaandroidjsonapiretrofit

How can I create pojo class of json array


How can I create pojo class of this type of JsonArray Below links response https://fakestoreapi.com/products/categories

[
"electronics",
"jewelery",
"men's clothing",
"women's clothing"
]

Solution

  • Just Use ArrayList Of String

    public class ClassName{
      @JsonProperty("MyArray") 
      public ArrayList<String> myArray;
    }