Skip to content

CONV-292: Add standard API error contract#252

Merged
menvil merged 1 commit into
developfrom
feature/CONV-292-add-standard-api-error-contract
Jun 3, 2026
Merged

CONV-292: Add standard API error contract#252
menvil merged 1 commit into
developfrom
feature/CONV-292-add-standard-api-error-contract

Conversation

@menvil

@menvil menvil commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds ApiErrorResponseFactory in app/Support/Api/ with stable {error: {code, message, details}} JSON shape
  • Details always an array (never null), status code set explicitly

Test plan

  • Factory returns correct shape with all parameters
  • Factory defaults to status 400 and empty details
  • composer test passes (521 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Implements the standard API error contract (CONV-292) by adding a factory that returns a consistent {error: {code, message, details}} JSON shape. Ensures details is always an array and status codes are set explicitly.

  • New Features
    • Added App\Support\Api\ApiErrorResponseFactory with make(code, message, status=400, details=[]) to enforce the contract.
    • Added unit tests for custom responses and defaults (400 status, empty details).

Written for commit e13befb. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 788ba4d5-5b80-4e8d-aad1-48c760cee803

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/CONV-292-add-standard-api-error-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@menvil menvil merged commit 872cd86 into develop Jun 3, 2026
1 of 2 checks passed
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.

1 participant