Upcoming/Uniform APIs type coercion change

24th June 2024

Uniform APIs type coercion change
Uniform APIs type coercion change

Background: Historically, our API has supported type-coercion within JSON body payloads. This allowed for flexibility such as submitting strings where integers were expected or using null values for non-nullable properties, which our system automatically converted to default values of the correct type.

Change Overview: To enhance the stability, accuracy, and overall developer experience, we will discontinue this type-coercion feature starting June 24th, 2024. This adjustment constitutes a potentially breaking change for any integrations that do not adhere strictly to our API schema and rely on this previously undocumented flexibility. Note that the coercion will continue functioning for parameters passed as part of the URL.

Implications of the Change:

  • Read Operations: If you are using the Uniform SDK/APIs solely for reading data from the Uniform platform, no action is required on your part. There will be no changes affecting read operations.
  • Write Operations with SDKs: If you are utilizing our SDKs to write data, rest assured that no action is required. Our TypeScript SDKs have always enforced correct data types, and your existing implementations will continue to function seamlessly.
  • Direct API Writes: If you are directly interfacing with our APIs to write data, you may be impacted by this change. It is crucial to ensure that the data you send strictly conforms to our published schema, which is available at Uniform API Schema.

Example of Change:

Current API Call (Accepted until June 24th, 2024):

1{
2    "projectId": "{{Project ID}}",
3    "categories": [
4        {
5            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
6            "name": "Some category",
7            "order": "10" // Currently accepts a string that represents an integer
8        }
9    ]
10

Required API Call Post-Change:

1{
2    "projectId": "{{Project ID}}",
3    "categories": [
4        {
5            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
6            "name": "Some category",
7            "order": 10 // Strictly requires an integer per schema definition
8        }
9    ]
10}
Breaking Changes