def as_json_api(*)
      attributes.slice(self.class.primary_key, :type).tap do |h|
        relationships_for_serialization.tap do |r|
          h[:relationships] = self.class.key_formatter.format_keys(r) unless r.empty?
        end
        h[:attributes] = self.class.key_formatter.format_keys(attributes_for_serialization)
      end
    end
def as_json_api(*)
      attributes.slice(self.class.primary_key, :type).tap do |h|
        relationships_for_serialization.tap do |r|
          h[:relationships] = self.class.key_formatter.format_keys(r) unless r.empty?
        end
        h[:attributes] = self.class.key_formatter.format_keys(attributes_for_serialization)
      end
    end
When we represent this resource for serialization (create/update), we do so
 with this implementation

 @return [Hash] Representation of this object as JSONAPI object