Skip to content

Commit cc66cd5

Browse files
authored
Fix API schema for Answer (#4054)
Related: - DIAGNijmegen/rse-gcapi#201 (comment) This allows the deduced spec/schema to resolve to set `nullable: True`, and subsequent derived models in gcapi to allow for `None` values.
1 parent ab1be80 commit cc66cd5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

app/grandchallenge/reader_studies/serializers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,14 @@ class AnswerSerializer(HyperlinkedModelSerializer):
207207
required=False,
208208
)
209209
answer_image = HyperlinkedRelatedField(
210-
read_only=True, view_name="api:image-detail"
210+
read_only=True,
211+
view_name="api:image-detail",
212+
allow_null=True,
213+
)
214+
total_edit_duration = DurationField(
215+
read_only=True,
216+
allow_null=True,
211217
)
212-
total_edit_duration = DurationField(read_only=True)
213218
# At the moment only non-ground-truth answers are created over REST
214219
is_ground_truth = BooleanField(read_only=True)
215220

0 commit comments

Comments
 (0)