Making properties read only

A read-only property is a property whose value cannot be set or modified through Cloud API. This can occur for the following reasons:

  • The property is read-only in the base application.
  • The property is settable in the base application, but there is a business requirement that it cannot be modified through Cloud API.

To set a property as read-only:

  1. In the schema file, set the readOnly property to true
  2. In the mapping file, specify a mapper as normal.
  3. Omit the property from the updater file.

For example, suppose the CustomEntity_Ext entity has an ExpirationDate field. The corresponding resource property is read-only. The property declaration would be:

  "definitions": {
    "CustomEntityExt": {
      ...
      "properties": {
        ...
        },
        "expirationDate": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
        ...

The mapping declaration would be:

  "mappers": {
    "CustomEntityExt": {
      "expirationDate": {
        "path": "CustomEntity_Ext.ExprationDate"
      }

There would be no updater declaration.