anchor.diff:         #+abcl &allow-other-keys)
     (if enabled
         (make-instance 'unserialization-resource-operation-implementation-decoration
  -		     :schema schema
  -		     :format format
  -		     :decorates resource-operation-implementation)
  +                     :schema schema
  +                     :format format
  +                     :decorates resource-operation-implementation)
         resource-operation-implementation))
  -  
  +
   (defmethod rs::execute :around ((decoration unserialization-resource-operation-implementation-decoration)
  -			    &rest args)
  +                                &rest args)
     (let ((posted-content (first args))) ;; Asume the posted content is in the first argument
       (apply #'call-next-method
  -	   (unserialize-with-schema (unserialization-schema decoration)
  -				    posted-content
  -				    (unserialization-format decoration))
  -	   (rest args))))
  +           (unserialize-with-schema (unserialization-schema decoration)
  +                                    posted-content
  +                                    (unserialization-format decoration))
  +           (rest args))))
   
   (cl-annot:defannotation unserialization (args resource-operation-implementation)
       (:arity 2)
  
positive.code: 
  ;; Schemas may be used either to serialize objects or validate input
  
  (defun serialize-with-schema (schema input 
  			      &optional (serializer rs.serialize::*serializer*) 
  				(stream rs.serialize::*serializer-output*))
    (%serialize-with-schema schema serializer input stream))
  
  (defmethod %serialize-with-schema (schema serializer input stream)
    (let ((schema-type (if (listp schema)
  			 (first schema)
  			 schema)))
      (%%serialize-with-schema schema-type schema serializer input stream)))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :list))
  				    schema serializer input stream)
    (serialize-schema-list schema serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :option))
  				   schema serializer input stream)
    (serialize-value serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :element))
  				   schema serializer input stream)
    (serialize-schema-element schema serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :integer))
  				   schema serializer input stream)
    (serialize-value serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :boolean))
  				   schema serializer input stream)
      (serialize-value serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :string))
  				   schema serializer input stream)
    (serialize-value serializer input stream))
  
  (defmethod %%serialize-with-schema ((schema-type (eql :timestamp))
  				   schema serializer input stream)
      (serialize-value serializer input stream))
  
  (defun serialize-schema-element (schema-element serializer input stream)
    (destructuring-bind (_ element-name attributes &rest options) schema-element
      (declare (ignore _))
      (with-element ((or (and (stringp element-name)
  			    element-name)
  		       (symbol-name element-name))
  		   :serializer serializer
  		   :stream stream)
        (loop for attribute in attributes
  	   do
  	   (serialize-schema-attribute attribute serializer input stream)))))
  
  (defun serialize-schema-attribute (schema-attribute serializer input stream)
    (destructuring-bind 
  	(attribute-name attribute-type &rest options)
        schema-attribute
      (let* ((accessor (symbol-function (or (getf options :accessor) attribute-name)))
  	   (attribute-value (funcall accessor input)))
        (when (not (and (getf options :optional) (not attribute-value)))
  	(with-attribute (attribute-name :serializer serializer
  					:stream stream)
  	  (cond
  	    ((getf options :serializer)
  	     (funcall (getf options :serializer) attribute-value))
  	    ((keywordp attribute-type)
  	     (serialize-attribute-value attribute-type attribute-value stream serializer))
  	    ((symbolp attribute-type)
  	     ;; It is a schema reference or a serializable class reference
  	     (let ((attribute-schema (find-schema attribute-type nil)))
  	       (if attribute-schema
  		   (%serialize-with-schema attribute-schema serializer attribute-value stream)
  		   ; else, try with a serializable class reference
  		   (let ((serializable-class (find-class attribute-type nil)))
  		     (if (and serializable-class
  			      (typep serializable-class 'serializable-class))
  			 (%serialize-with-schema (serializable-class-schema serializable-class)
  						 serializer attribute-value stream)
  			 ; else
  			 (error "Could not resolve reference ~A when serializing" attribute-type))))))
  	    ((listp attribute-type)
  	     (%serialize-with-schema attribute-type
  				     serializer
  				     attribute-value
  				     stream))))))))
  
  (defmethod serialize-attribute-value (attribute-type attribute-value stream &optional (serializer rs.serialize::*serializer*))
    (serialize attribute-value serializer stream))
  
negative.code: (defun element-unserializer (element)
    "Returns the unserializer of the element if any"
    (let ((unserializer (element-option :unserializer element)))
      (second unserializer)))
  
  ;; (element-unserializer '(:element user () (:unserializer unserialize-user)))
  
  (defun unserialize-with-schema (schema string-or-data &optional (format :json))
    (let ((data (if (stringp string-or-data)
                    (rs::parse-api-input format string-or-data)
                    string-or-data)))
      (unserialize-schema-element schema data)))
  
  (defun unserialize-schema-element (element input)
    "Unserializes an schema element
  