Skip to content

Conversation

@AlaaElattar
Copy link
Contributor

Description

  • Integrate validator pkg to validate structs.

Changes

  • Integrate validator pkg to validate structs.

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

@AlaaElattar AlaaElattar marked this pull request as draft August 4, 2025 09:55
@AlaaElattar AlaaElattar marked this pull request as ready for review August 5, 2025 07:12
}

if err := internal.ValidateStruct(request); err != nil {
Error(c, http.StatusBadRequest, "Validation failed", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is error readable for the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Example for the error, what do u think ?
    "status": 400,
    "message": "Invalid request format",
    "error": "Key: 'RegisterInput.ConfirmPassword' Error:Field validation for 'ConfirmPassword' failed on the 'eqfield' tag"
} 

@AlaaElattar AlaaElattar requested a review from rawdaGastan August 7, 2025 12:41
@AlaaElattar
Copy link
Contributor Author

@AlaaElattar AlaaElattar merged commit f750f64 into master Aug 10, 2025
2 checks passed
@AlaaElattar AlaaElattar deleted the master_validator branch August 10, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants