-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The current API endpoints for attendances deviate from RESTful standards in several places. This ticket aims to align all attendance endpoints with strict REST principles.
Goals:
-
Use standard HTTP status codes
- Return
201 Createdon successfulPOST - Include
Locationheader pointing to the new resource (e.g./api/attendances/{id}) - Use
200 OK,204 No Content,400 Bad Request, etc. where appropriate
- Return
-
Remove non-standard response wrappers
- Eliminate custom message-based wrappers like
{ message: "...", data: ... } - Return plain resources or standardized error formats (e.g. RFC 7807 ProblemDetails)
- Eliminate custom message-based wrappers like
-
Correct use of HTTP methods
GET /api/attendances→ Fetch all attendances (optionally with filters, pagination, sorting)GET /api/attendances/{id}→ Fetch a single attendancePOST /api/attendances→ Create a new attendancePUT /api/attendances/{id}→ Full updatePATCH /api/attendances/{id}→ Partial updateDELETE /api/attendances/{id}→ Delete attendance
-
Consistent URL structure
- Use plural, noun-based routes (e.g.
/api/attendances) - Avoid action-based verbs in routes (e.g. no
/api/createAttendance)
- Use plural, noun-based routes (e.g.
-
Dynamic
Locationheader- After
POST, return aLocationheader with the GET URL for the created attendance (e.g./api/attendances/{id}) - Use attribute routing or reflection to construct the URL dynamically if necessary
- After
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels