Closed GoogleCodeExporter closed 8 years ago
Sorry, the file WEB-INF/jslib/test.js was wrong in the original report. It
should be like this:
Class({
id : "Test",
properties : {
title : { type : "string" },
created : { type : "integer", readonly : true, optional : true }
},
prototype : {
initialize : function() {
this.created = (new Date()).getTime();
}
}
});
Original comment by Micha.Ni...@gmail.com
on 27 Jul 2009 at 9:14
Sorry, you can't use PUT for differential updates, the semantics of a PUT (per
RFC
2616) indicate that the entity must be a full representation of the object.
Consequently, omitting a property that existed before indicates that the client
is
requesting that the property be removed. In order to do a PUT with your object,
you
need to actually look at the full object (returned by the POST or a GET), and
include
the created property, unchanged.
I have considered allow for differential updates like this with a POST (like
POST
/Test/1 '{title: "test2"}'). Would you like that?
Original comment by kris...@gmail.com
on 27 Jul 2009 at 9:23
Sorry, I did not realize that. But it also fails when you do a PUT with the
complete
object:
GET /Test/1
HTTP/1.1 200 OK
'{id: "1", title: "test1", created: 1248728516129}'
Then:
PUT /Test/1 '{id: "1", title: "test1", created: 1248728516129}'
HTTP/1.1 403 Forbidden
"TypeError: property is a readonly property for property created"
With respect to the POST update, sure that sounds like a useful thing to have.
Original comment by Micha.Ni...@gmail.com
on 27 Jul 2009 at 9:34
Add support for POST-based incremental updates to objects, and fixed problem
with
setting a property value with same number.
Original comment by kris...@gmail.com
on 28 Jul 2009 at 2:03
Original issue reported on code.google.com by
Micha.Ni...@gmail.com
on 27 Jul 2009 at 9:11