Repository navigation
Do not send an included emergency calling service back in a DID update - #77
Conversation
The API lets an update only unassign a DID's emergency calling service. A DID read with include=emergency_calling_service sent the service back on any update, and the API refused it with 422 emergency_calling_service - is invalid. Only unassignment is allowed. The relationship is now marked serialise = false; setting it to null still sends data: null, through the same path as before.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to omit included emergency calling services from DID updates.
No open issues 🎉
What changed in this PR
Extends #76’s DID update handling to prevent included emergency calling services from being sent back to the API, avoiding rejected updates while preserving explicit unassignment.
Changes:
- Marks the DID’s emergency calling service relationship as non-serializable.
- Extends the regression test and fixture to verify included service data remains readable but is omitted from updates.
| File | Description |
|---|---|
src/test/resources/fixtures/dids/show_with_included_read_only_relationships.json |
Adds emergency calling service linkage and included attributes. |
src/test/java/com/didww/sdk/resource/DidTest.java |
Extends the update regression test to include and read the emergency service. |
src/main/java/com/didww/sdk/resource/Did.java |
Disables serialization of the emergency calling service relationship. |
Review effort: Balanced



Summary
This follows #76. A DID update may only unassign the DID's emergency calling service, never set or keep it. A DID read with
include=emergency_calling_servicestill sent the service back on every update, so the API refused the whole update:emergency_calling_serviceis now markedserialise = false, like the four read-only relationships in #76. Unassigning still works:did.setEmergencyCallingService(null)marks the field changed, and the update sendsemergency_calling_service: {data: null}through the same path as before.Found by running the examples against the sandbox:
DidsExamplefailed once the newest DID had an emergency calling service.Tests
DidTest.testUpdateDidLoadedWithIncludeDoesNotResendReadOnlyRelationshipsnow also includes an emergency calling service. It checks the service is read, with its name, and is not sent back. Without the change the test fails.testUpdateDidUnassignEmergencyCallingServicestill sendsdata: null../gradlew testpasses.