The JSON input normally won't have "content" or "heading" fields. The tool will need to determine whether fields are missing, create the right API call to fill in the blanks, and then load the object with the marshmallow schema.
Does the API call need to happen in a pre-load function in the serializer itself, to fit with the existing interface? If so that's horrible. If it needs to happen right after collect_enactments but before the serializer (modifying the contents of the EnactmentIndex), that's not quite as bad.
The JSON input normally won't have "content" or "heading" fields. The tool will need to determine whether fields are missing, create the right API call to fill in the blanks, and then load the object with the marshmallow schema.
Does the API call need to happen in a pre-load function in the serializer itself, to fit with the existing interface? If so that's horrible. If it needs to happen right after
collect_enactments
but before the serializer (modifying the contents of theEnactmentIndex
), that's not quite as bad.