---
schema_version: "1"
id: ee6f6eb08f73980ed4797578b6528b4473339fe90b5d7c5534c20f70d56d249b
title: |-
  ConnectApi Versioning and Equality
      Checking
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_connectapi_versioning.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_versioning.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1134b5d122bc2093b60619fa20d0a4971c1d85c6411f1d4511e587059f9d4662
description: Versioning in ConnectApi classes follows specific rules that are different than the rules for other Apex classes.
---
# ConnectApi Versioning and Equality Checking

Versioning in ConnectApi classes follows specific rules that are different than the rules for other Apex classes.

Versioning for ConnectApi classes follows these rules.

- A ConnectApi method call executes in the context of the version of the class that contains the method call. The use of version is analogous to the /vXX.X section of a Connect REST API URL.
- Each ConnectApi output object exposes a getBuildVersion method. This method returns the version under which the method that created the output object was invoked.
- When interacting with input objects, Apex can access only properties supported by the version of the enclosing Apex class.
- Input objects passed to a ConnectApi method may contain only non-null properties that are supported by the version of the Apex class executing the method. If the input object contains version-inappropriate properties, an exception is thrown.
- The output of the toString method only returns properties that are supported in the version of the code interacting with the object. For output objects, the returned properties must also be supported in the build version.
- Apex REST, JSON.serialize, and @RemoteAction serialization include only version-appropriate properties.
- Apex REST, JSON.deserialize, and @RemoteAction deserialization reject properties that are version-inappropriate.
- Enums are not versioned. Enum values are returned in all API versions. Clients should handle values they don't understand gracefully.

Equality checking for ConnectApi classes follows these rules.

- Input objects—properties are compared.
- Output objects—properties and build versions are compared. For example, if two objects have the same properties with the same values but have different build versions, the objects are not equal. To get the build version, call getBuildVersion.