Develop > Application Programming Interface > Legacy APIs > Primitive values reset to default

Primitive values reset to default if no value is provided

When you make a PUT request from the REST API, if you do not provide values for primitive properties, these properties are set to their default values.

Some properties of an artifact are modeled in Java using primitive types. This can cause certain issues when using the PUT requests via REST API. When a PUT request is sent to the CSA instance using a REST API, the data that represents an artifact or a part of an artifact is converted to a java object. All properties with primitive types in a Java object always need to have values. When you do not provide values for these properties, the default values are used to satisfy the requirement.

The following are the primitive types in Java:

  • byte
  • short
  • int
  • long
  • float
  • double
  • char
  • boolean

Workaround: Invoke a GET call first, and then modify only the necessary properties from the GET response. This modified response should be sent as part of the PUT request.