Skip to content

refactor: update validation error handling for zog v0.22#24

Merged
pcfreak30 merged 2 commits intodevelopfrom
update-zog
Dec 30, 2025
Merged

refactor: update validation error handling for zog v0.22#24
pcfreak30 merged 2 commits intodevelopfrom
update-zog

Conversation

@pcfreak30
Copy link
Copy Markdown
Member

@pcfreak30 pcfreak30 commented Dec 30, 2025

  • Remove deprecated z.Issues.SanitizeMap() usage
  • Use issue.PathString() and issue.Message directly
  • Fix field name casing in validation tests to match struct fields
  • Upgrade Go to 1.24.0 and toolchain to go1.24.3
  • Update zog to v0.22.0, echo/v4 to v4.14.0, and testify to v1.11.1
  • Add docker/go-units for size unit handling in tests

This pull request primarily refactors the validation error handling to align with updates in zog v0.22.

Key changes include:

  • Updated Validation Error Processing: The system now directly processes zog.Issue objects to extract validation error paths and messages, removing an intermediate sanitization step and simplifying the error handling logic in RequestContext.Validate and RequestContext.ValidateRequest.
  • Adjusted Validation Tests: Validation tests have been updated to reflect the new error handling mechanism, including correcting schema field names to match Go's exported struct field conventions and updating expected error messages and formats. Mock validators are also now explicitly initialized with field values.
  • Improved File Size Readability in Tests: File upload size limits in http_test.go now use the github.com/docker/go-units package for better readability and maintainability.
  • Added Git-Town Configuration: A git-town.toml file has been added to configure Git-Town, standardizing repository workflow settings such as branch naming, hosting type, and sync strategies.

- Remove deprecated `z.Issues.SanitizeMap()` usage
- Use `issue.PathString()` and `issue.Message` directly
- Fix field name casing in validation tests to match struct fields
- Upgrade Go to 1.24.0 and toolchain to go1.24.3
- Update zog to v0.22.0, echo/v4 to v4.14.0, and testify to v1.11.1
- Add docker/go-units for size unit handling in tests
@pcfreak30
Copy link
Copy Markdown
Member Author

@kody start-review

@kody-ai

This comment has been minimized.

Comment thread validation.go
Copy link
Copy Markdown

@kody-ai kody-ai Bot left a comment

Choose a reason for hiding this comment

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

- Changed validation error filtering from checking path length to checking message length
- Root-level errors (empty path) are now properly captured instead of being silently dropped
- Added tests for Validate() and ValidateRequest() to verify root-level error handling
@kody-ai
Copy link
Copy Markdown

kody-ai Bot commented Dec 30, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Breaking Changes
Cross File
Kody Rules
Code Style
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization

Access your configuration settings here.

@pcfreak30 pcfreak30 merged commit f7a237f into develop Dec 30, 2025
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.

1 participant