Skip to content

[JITERA] Implement PATCH endpoint for partial book updates

chi le requested to merge feat/patch-book-update-1763455000 into main

Created by: chi-jitera

Overview

This pull request implements the PATCH endpoint for updating book records in the API. It allows for partial updates of book fields and includes validation for the `publishedDate` to ensure it is not set in the future.

## Changes
- **Added PATCH method support**: The handler now supports the PATCH method alongside the existing DELETE method.
- **Validation for publishedDate**: If the `publishedDate` field is included in the request body, it is validated to ensure it is not a future date.
- **Partial updates**: Only the fields present in the request body are updated in the in-memory book store.
- **Standardized responses**: The API now returns:
  - `200` for successful updates with the updated book object.
  - `400` for validation errors or missing data.
  - `404` if the specified book is not found.
  - `405` if the method is not allowed.

Merge request reports