Skip to content

Fix/compliance response mapping#263

Merged
koushiksk-plivo (koushiksk-plivo) merged 5 commits into
masterfrom
fix/compliance-response-mapping
Apr 17, 2026
Merged

Fix/compliance response mapping#263
koushiksk-plivo (koushiksk-plivo) merged 5 commits into
masterfrom
fix/compliance-response-mapping

Conversation

@koushiksk-plivo
Copy link
Copy Markdown
Contributor

No description provided.

Koushik SK and others added 5 commits April 16, 2026 19:06
The API returns GET responses wrapped under a 'compliance' key and list
responses under a 'compliances' key, but the SDK expected flat responses
and 'objects' respectively. Override get() to extract the compliance
wrapper and list() to remap 'compliances' to 'objects' for base class
compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The PATCH update response wraps data under a 'compliance' key, but
update() was passing the raw response to parse_and_set, causing fields
like alias, status, and compliance_id to not be set on the resource.
Apply the same unwrapping logic already used by get().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sistent

- Update GET mock to wrap response under 'compliance' key
- Update LIST mock to use 'compliances' key instead of 'objects'
- Update UPDATE mock to wrap response under 'compliance' key
- Update test assertions to verify unwrapping/remapping logic
- Use consistent || fallback pattern in update() matching get()
- Add comment explaining message field injection into resource state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@koushiksk-plivo koushiksk-plivo (koushiksk-plivo) merged commit 1302f2a into master Apr 17, 2026
8 of 11 checks passed
@koushiksk-plivo koushiksk-plivo (koushiksk-plivo) deleted the fix/compliance-response-mapping branch April 17, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants