Hello,



As in ResourceType Specification

"An Update request that includes properties designated in the schema as
ReadOnly shall be processed by the OIC Server as if the ReadOnly properties
were not included (that is, they are ignored)."



For Modeling a Resource in RAML, I had a concern on representing the
Read-Only properties.

As per my understanding with an example of "refrigeration", in file
"oic.r.refrigeration.json" used to represent the schema for GET request. 

It contains the current Resource representation. 

Here property "filter" is read-only.




"properties": {

        "filter":       {

          "type": "integer",

          "description": "ReadOnly, Percentage life time remaining for the
water filter"

        }.















Schema for POST request will be "oic.r.refrigeration-Update.json". It will
contain the representation the client can update without any read-only
attributes. 

And hence read-only property "filter" will not be there in UPDATE request
schema.



Please let me know if my understanding is correct or if there is any other
way to distinguish the read-only attributes other than the "description"
mentioned in the smart home vertical RAML and JSONs.




RAML snippet

Refrigeration:                  !include oic.r.refrigeration.json

RefrigerationUpdate:     !include oic.r.refrigeration-Update.json



get:

  responses:

    200:

      body:

        application/json:

          schema: Refrigeration

post:

  body:

    application/json:

      schema: RefrigerationUpdate



https://workspace.openinterconnect.org/apps/org/workgroup/smarthome_tg/downl
oad.php/3116/oic.r.refrigeration-Update.json

https://workspace.openinterconnect.org/apps/org/workgroup/smarthome_tg/downl
oad.php/4086/oic.r.refrigeration.json







Regards,

Abitha.S





-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160111/f5dd785a/attachment.html>

Reply via email to