Skip to content

🐛 fix: Include Nested Paths in Config Validation Errors - #139

Merged
danny-avila merged 1 commit into
mainfrom
fix/validation-error-paths
Aug 25, 2026
Merged

🐛 fix: Include Nested Paths in Config Validation Errors#139
danny-avila merged 1 commit into
mainfrom
fix/validation-error-paths

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Config field validation currently drops nested Zod issue paths, so failures inside objects and arrays only identify the top-level field. This makes it difficult to locate the specific invalid value.

This PR preserves each issue path when formatting validation errors. A missing nested field now reports its array index and property path, while top-level validation messages retain their existing format.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

Added regression coverage for a missing required field inside a custom-endpoint array entry.

  • bun run test src/server/config.test.ts (497 tests passed)
  • bunx eslint src/server/config.ts src/server/config.test.ts
  • bunx prettier --check src/server/config.ts src/server/config.test.ts

Test Configuration:

  • Bun 1.3.3

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

@dustinhealy dustinhealy changed the title Improve nested config validation error paths 🐛 fix: Include Nested Paths in Config Validation Errors Aug 25, 2026
@dustinhealy
dustinhealy marked this pull request as ready for review August 25, 2026 16:34
@danny-avila
danny-avila merged commit 522e8cd into main Aug 25, 2026
3 checks passed
ahammadabdullah added a commit to Rangs-Group/ria-chat-admin that referenced this pull request Aug 27, 2026
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.

2 participants