coolify/app/Http/Controllers/Api
Andras Bacsai fa8393184f refactor: improve validation error handling and coding standards
Changes:
1. Add explicit try-catch blocks around validateDockerComposeForInjection()
   in API endpoints to return proper 422 JSON responses with validation errors
2. Rename $service_payload to $servicePayload for PSR-12 compliance (camelCase)

API endpoints now properly handle validation failures:
- One-click service creation (line 334)
- Custom compose service creation (line 480)
- Service update endpoint (line 808)

All return consistent error format:
{
  "message": "Validation failed.",
  "errors": {
    "docker_compose_raw": "Invalid Docker Compose service name: ..."
  }
}

Livewire components already have proper exception handling via handleError().

All 60 security tests pass (176 assertions).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 09:51:37 +02:00
..
ApplicationsController.php fix: improve Docker image digest handling and add auto-parse feature 2025-10-15 10:19:01 +02:00
DatabasesController.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
DeployController.php refactor(deployment): add validation for pull request existence in deployment process to enhance error handling 2025-09-10 14:31:29 +02:00
GithubController.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
OpenApi.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
OtherController.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
ProjectController.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
ResourcesController.php feat(auth): implement comprehensive authorization checks across API controllers 2025-08-23 18:51:10 +02:00
SecurityController.php fix: missing 422 error code in openapi spec 2025-10-12 14:20:45 +02:00
ServersController.php Merge branch 'next' into fix/openapi 2025-10-13 10:42:05 +02:00
ServicesController.php refactor: improve validation error handling and coding standards 2025-10-16 09:51:37 +02:00
TeamController.php fix: hide sensitive email change fields in team member responses 2025-09-18 00:40:09 +08:00