Refactor serializers to match media models and ES indices #745
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
help wanted
Open to participation from the community
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: api
Related to the Django API
Description
Clean up the use of validations such as
allow_null
,allow_blank
andrequired
in serializers:Hit
when searching but forMedia
subclasses when retrieving details. This can cause issues due toHit
fields being a subset of those inMedia
.Since the serializers are not structured in correspondence to the mixins making up media classes, they tend to go out of sync when the Django models are migrated or when ES indices change.
Expectation
Validations should be used cautiously and with documentation so that they can stay up to date with changes to
Media
(made by Django model migrations) or changes toHit
(made by changes to ES indices).Resolution
The text was updated successfully, but these errors were encountered: