Update Author (v1.0.0)

Update an author's information

Overview

Update an existing author in the catalog domain. This endpoint adheres to Domain-Driven Design principles by:

  • Enforcing domain rules and invariants during update operations
  • Validating author data against the bounded context constraints
  • Generating domain events upon successful updates
  • Maintaining aggregate consistency

The operation is idempotent and will return appropriate error responses if the author ID does not exist or if business rules are violated. Updates will be propagated through domain events to maintain consistency across the system.

Security

  • Requires administrative privileges (Admin policy)
  • Authentication is required

Technical Details

Validation Rules

  • Author ID must be a valid GUID and cannot be empty
  • Author name is required
  • Author name must not exceed the large data schema length

Implementation Notes

  • Uses CQRS pattern with Mediator implementation
  • Performs optimistic concurrency control through unit of work
  • Implements proper domain event handling
  • Returns 204 No Content on successful update

Architecture

PUT (/api/v1/authors/{id})

Parameters

  • id (path) (required)
    • Format: GUID
    • Description: Unique identifier of the author to update

Request Body

Example Usage

curl -X PUT "https://api.bookworm.com/api/v1/authors" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <admin-token>" \
  -d '{
    "id": "01961eb4-668d-7e7e-ae25-0fab379614f7",
    "name": "Updated Author Name"
  }'

Responses

204 No Content

Returned when the author is successfully updated.

400 Bad Request

Returned when:

  • The request body fails validation
  • The author name format is invalid
  • The author name exceeds maximum length

404 Not Found

Returned when the specified author ID does not exist in the system.

401 Unauthorized

Returned when the request lacks valid authentication credentials.

403 Forbidden

Returned when the authenticated user lacks administrative privileges.

1 property
name string
required

Author name

Min length: 1
Max length: 100
6 properties
type string
title string
status integer <int32>
detail string
instance string
errors object