code: def record_responsify(serializer, mimetype):
      
      def view(pid, record, code=200, headers=None, links_factory=None):
          response = current_app.response_class(
              serializer.serialize(pid, record, links_factory=links_factory),
              mimetype=mimetype)
          response.status_code = code
          response.set_etag(str(record.revision_id))
          response.last_modified = record.updated
          if headers is not None:
              response.headers.extend(headers)
  
          if links_factory is not None:
              add_link_header(response, links_factory(pid))
  
          return response
  
      return view
docs: Create a Records-REST response serializer.
  
      :param serializer: Serializer instance.
      :param mimetype: MIME type of response.
      :returns: Function that generates a record HTTP response.