Skip to content

DTO validation with jakarta.validation and @Valid in controllers #41

@sugan0tech

Description

@sugan0tech
  • Description: Add validation annotations to DTOs and enforce with @Valid.
  • Current state: DTOs like UserSigninDTO, CreateElementRequest, CreateAvatarRequest lack validation; many controllers accept Map instead of typed DTOs.
  • Tasks:
    • Add dependency spring-boot-starter-validation and annotate DTO fields (@NotBlank, @Size, @Positive, etc.).
    • Change controller signatures to use typed DTOs and @Valid.
    • Provide meaningful validation messages.
  • Acceptance criteria:
    • Invalid payloads yield 400 with field errors through the global handler.
  • References: DTOs in features/*, multiple controllers (e.g., AuthController, SpaceController).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions