Appearance
API Overview
Every @SquizyEntity automatically exposes a full REST API under /api/{entity-name}. The entity name is the lower-cased JPA entity name.
Base URL
/api/{entity}For an entity class named Product, all endpoints are under /api/product.
Endpoint Reference
| Method | Path | Description |
|---|---|---|
GET | /api/{entity} | List all records (no pagination) |
GET | /api/{entity}?page=0&size=10&sort=field;asc | List records with pagination and sort |
GET | /api/{entity}/{id} | Get a single record by ID |
GET | /api/{entity}?id=1&id=2 | Get multiple records by ID |
POST | /api/{entity} | Create a new record |
POST | /api/{entity}/query | Query with filters, sorting and pagination |
PATCH | /api/{entity}/{id} | Update a single record (JSON Patch) |
PATCH | /api/{entity} | Bulk update (JSON Patch) |
DELETE | /api/{entity}/{id} | Delete a single record |
DELETE | /api/{entity}?id=1&id=2 | Delete multiple records |
POST | /api/{entity}/export | Export to CSV |
GET | /api/{entity}/{id}/revisions | List revisions for a record |
GET | /api/{entity}/{id}/revisions/{rev} | Get entity state at a specific revision |
GET | /api/{entity}/revisions/summary | List all revisions for the entity type |
GET | /api/{entity}/{id}/properties/{prop} | Get a property value |
POST | /api/{entity}/properties/{prop}/query | Query property values (dropdown options) |
Paginated Response Format
Endpoints that return paginated results share a common response shape (Spring Page):
json
{
"content": [ /* array of entities */ ],
"totalElements": 42,
"totalPages": 5,
"size": 10,
"number": 0
}| Field | Description |
|---|---|
content | The entities on the current page |
totalElements | Total number of matching records |
totalPages | Total number of pages |
size | Page size used |
number | Current page index (0-based) |