Skip to content

Separate domain entities from API DTOs to prevent data leakage and improve API design #34

@Thiagooms

Description

@Thiagooms

Currently, the application exposes domain entities directly in REST API endpoints. This approach has several drawbacks:

Examples of current issues:

  • UserController returns the User entity directly, exposing the password hash and internal fields.
  • BlogController uses the Blog entity for both the request and response, making it difficult to customize the API format.
  • No distinction between create/update/response representations.

assign me this task please @Prathamesh-007

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions