SEL-Columbia/dokomoforms

Change conditional field existince in JSON API

vr2262 opened this issue · 1 comments

At the moment, if a field has no value in the JSON API, it isn't rendered at all. (For example, the choices field of a question should only appear if the type_constraint_name is multiple_choice).

@csytan brought up the point that it can be easier to consume the data if the fields were always there, but we represent no value with JSON null.

SEL-Columbia:a581749...SEL-Columbia:2e6c37c

These commits in the all_json_fields_present branch make all the JSON fields mandatory. The result is more verbose, but maybe not too verbose.

Take a look to see if this seems sensible @csytan @dpapathanasiou