Changes
Non-Breaking Change
A non-breaking change is any update to the API that does not require existing clients to change their behavior or implementation. Existing clients continue to work as expected.
Example of Non-Breaking Change
| Scenario | Why It's Non-Breaking |
|---|---|
| Adding a new optional field | Clients can ignore fields they don't recognize. |
| Adding a new endpoint | Clients using old endpoints remain unaffected. |
| Extending enum values | Clients can default to ignoring unknown values. |
| Increasing a limit (e.g., pagination) | Clients using previous limits still function. |
Example: Adding a New Field
Old Response:
{
"id": 1,
"name": "Alice"
}
New Response(Non-Breaking)
{
"id": 1,
"name": "Alice",
"nickname": "Ally"
}
Why it's non-breaking: Existing clients that don't expect nickname will simply ignore it.
Breaking Change
A breaking change is any modification that requires existing clients to change their code in order to continue functioning properly.
Example of Breaking Changes
| Scenario | Why It's Breaking |
|---|---|
| Removing an existing field | Clients depending on it may break. |
| Renaming a field | Client parsing will fail. |
| Changing a field’s data type | Data may be incompatible. |
| Changing URL structure or HTTP methods | Clients using hardcoded URLs/methods will break. |
| Changing authentication mechanism | Clients using the old auth method fail. |
Example: Renaming a Field
Old Response:
{
"id": 1,
"name": "Alice"
}
New Response(Breaking)
{
"id": 1,
"fullName": "Alice"
}
Why it's breaking: Existing clients looking for name will no longer find it and may throw errors.