Modify a resource property: JSON

A text property can contain JSON. The API treats changes to this type of property as any text. If the field is tagged restapi_json on the other hand, it will be necessary to pass a valid JSON as the value to assign to the property.
The restapi_json tag can be specific:

  • restapi_json/object : the JSON must be an object

  • restapi_json/array : the JSON must be an array

The value to be assigned can be directly indicated in JSON, or as a string that represents JSON.

Examples:

{ "property": { "a": 1, "b": 2, "c": 3 } }

 

{ "property": "{\r\n \"a\": 1,\r\n \"b\": 2,\r\n \"c\": 3\r\n}" }

 

Â