Answer the question
In order to leave comments, you need to log in
Return or not the value of empty fields?
There are fields 'user_id', 'country_id', 'city_id' which are returned by the API method blah blah blah.
The user's country and city may not be filled in, that is, country_id = 0 and city_id = 0. Which is
better, is it more correct to return these fields, with zeros or not return them at all in this case?
Answer the question
In order to leave comments, you need to log in
When you design an API, among other things, you set the response schema. And all answers should be formed according to this scheme. Those. yes, fields must be returned filled with zeros (or null).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question