I have the following return in json
{
"cardapio": [
{
"tipoprato": "SALADAS",
"pratos": [
{
"prato": "ALFACE + REPOLHO ROXO"
}
]
},
{
"tipoprato": "PRATO PRINCIPAL",
"pratos": [
{
"prato": "ESTROGONOFE DE GR?O DE BICO"
},
{
"prato": "GALETTE DE PVT, GLUTEN E QUEIJO MUCARELA"
}
]
},
{
"tipoprato": "ACOMPANHAMENTO",
"pratos": [
{
"prato": "FEIJ?O C/ MAXIXE, QUIABO E COUVE"
},
{
"prato": "ARROZ BRANCO"
},
{
"prato": "ARROZ INTEGRAL"
}
]
},
{
"tipoprato": "CALDOS",
"pratos": [
{
"prato": "CALDO DE COUVE - FLOR"
}
]
}
]
}
At first it would be two classes: TipoPrato and Plates.
My question is how would I bring this result to retrofit?
I'm new to retrofit.
Would it take two classes?
class Cardapio{
private String tipo;
private Prato[] prato;
...
}
Class dish
class Prato{
private String prato;
}
My interface
GET("/restaurante/")
public void getCardapio(
Callback<List<Cardapio>> cardapioList;
);
Or would it be better to separate each thing, bring only the Types of Dishes then just the dishes?
My goal then is to make an expandable list