Saving more note updates

This commit is contained in:
Scott Idem
2026-01-09 17:10:25 -05:00
parent 4b86432381
commit 5ce193d474
2 changed files with 41 additions and 25 deletions

View File

@@ -26,3 +26,16 @@ The V3 CRUD system is now modularized into:
- `app/routers/api_crud_v3_nested.py`: Relational/child object routes.
- `app/lib_api_crud_v3.py`: Shared security, filtering, and sanitization logic.
- `app/lib_schema_v3.py`: Database and model introspection logic.
## New DX Features
### 1. Error Bubbling
Database and Validation errors are no longer swallowed.
- **Validation Errors**: Specific Pydantic validation failures are returned in `meta.details`.
- **Database Errors**: MariaDB constraint violations (e.g., Duplicate Entry, Not Null) are captured and cleaned up via `format_db_error()` and returned in `meta.details`.
### 2. Validation Endpoint
**Route**: `POST /v3/crud/{obj_type}/validate`
- **Purpose**: Dry-run validation of a payload against the Pydantic model.
- **Behavior**: Returns `data: true` if valid, or a 400 error with specific details if invalid. No database operations are performed.