Symptoms
An operation to modify an APS 2 resource fails with a message similar to this:
{
"error": "APS::Controller::Validation::ValidationError",
"message": "'locale': can't update property marked as 'readonly'",
"code": 1001
}
Cause
In Operations Automation 6.0 support for final
and readonly
for resource properties is implemented.
Now even required properties can be declared with final
and readonly
attributes and these attributes are respected by the APS controller.
final
indicates that the resource property can only be assigned a value on resource creation. In other words, the attribute allows a user or an application the POST and GET operations, but does not allow PUT.
readonly
attribute means that the resource property cannot be set or changed through the user interface of the application. Only the application itself can modify values marked as readonly (e.g. updates to readonly
fields must be implemented in endpoint scripts and will not work from the custom UI).
This can cause problems if a property was marked as readonly
by mistake in an APS package, or if final
and readonly
attributes were mixed up.
Resolution
Check in resources schemas for your application that you declare correct property attributes and that you make modifications in a proper way, e.g. that all attempts to update a readonly
property are only done by the application endpoint and no attempts to change final
properties are made.
Details about these and other property attributes are available in properties documentation.