Answer the question
In order to leave comments, you need to log in
How to submit JSON to POJO to work with Retrofit?
I'm doing a lab for uni. The task is to request the current weather from the server using retrofit and display the answer. As I understand it, for retrofit to work, you need to make a class that will have all the fields like the answer. The problem is that in all the examples that I found, the fields have a simple type, int or string, and my server responds with a complex object, where there are several fields, each field also has several fields, and so on. To simplify, it is suggested to feed this answer to the jsonschema2pojo site, and he will do everything himself, but there are a lot of settings, and I do not understand what to choose.
Can you please tell me how can I end up with this class? And is it necessary to reflect all 20-30 response fields in it at all, if in fact I need only one temperature field? Is it possible to specify in the class only the field I need?.
Answer the question
In order to leave comments, you need to log in
As I understand it, for retrofit to work, you need to make a class that will have all the fields like the answer.misunderstood
Do I need to reflect all 20-30 response fields in it at all, if in fact I need only one temperature field?not necessary
Is it possible to specify in the class only the field I need?.could
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question