Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ValidationError.formatError() clobbering path param #2250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shaungrady
Copy link
Contributor

@shaungrady shaungrady commented Sep 30, 2024

Changes

  • ValidationError.formatError() overwrites path with a more friendly label string (if defined) for more friendly error message interpolation; however, this causes the path data to be lost entirely.
    • Rather than undertake refactoring this logic and cause a breaking change, where using alternative values for interpolating ${path} within error strings should arguably be a concern that's left to the message function, I opted to simply create a new params property—originalPath—for recording this value.
  • Update MessageParams type with originalPath: string; property
  • Add MessageParams and AnyMessageParams to library exports
    • I couldn't see a reason why these types are private, and I'd certainly love to make use of them.

And export `AnyMessageParams`, `MessageParams` types.
@shaungrady shaungrady changed the title Fix ValidationError.formatError() clobbering path param Fix ValidationError.formatError() clobbering path param Sep 30, 2024
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