code: def _flatten_marshmallow_errors(errors):
      
      res = []
      for field, error in errors.items():
          if isinstance(error, list):
              res.append(
                  dict(field=field, message=' '.join([str(x) for x in error])))
          elif isinstance(error, dict):
              res.extend(_flatten_marshmallow_errors(error))
      return res
docs: Flatten marshmallow errors.