9 OBJECTS OF TYPE RESOURCE
The "Object of Type" resource is the target of a persist link to persist a proto-persistent ("not yet persisted") object §A2.2 of a given domain type.
The overall process is:
-
client invokes an action that creates a proto-persistent object representation
-
client uses the "arguments" json-property of the "rel"="…/persist" link to determine the information required
-
client obtains the required information, for example, prompting for it in a user interface
-
client posts the arguments map back to the Objects resource, with the missing information
-
assuming that the values are valid, a representation of the newly persisted domain object is returned
-
the response code is 201, and will have the Location header
-
the representation itself will now include the "self" link, the "instanceId" json-property (and the "domainType" json-property if simple scheme §A3.1.1).
-
The endpoint for this resource is: /objects/{domainType} where:
-
{domainType} uniquely identifies the domain type of the objects being persisted
9.1 HTTP POST
Persist a domain object by posting a cut-down version of its representation.
9.1.1 POST Request
9.1.1.2 Body
Because this resource is in a sense "uploading" a new object, the body is the cut-down version of the domain object representation §C14.4 [1]. It consists of:
-
members[memberType=property]
In other words, it includes all properties and their values (including those that would normally be hidden), along with a reference to the domaintype of the object being persisted.
In addition, it may include the reserved query parameter:
-
x-ro-validate-Only
-
"true"
-
validate that the representation provided could be persisted as a new object, without actually persisting it.
-
-
For example:
{
"members": {
"firstName": {
"value": ...
},
"lastName": {
"value": ...
}, ...
}
}
9.1.4 POST Invalid Request
For example, if the body is malformed, or any other syntax error.
9.1.4.3 Body
Error representation, §B10.