fix: resolve nullable type lookup bypassing custom value parsers#608
fix: resolve nullable type lookup bypassing custom value parsers#608natemcmaster merged 2 commits intomainfrom
Conversation
Move the nullable type unwrap check before the TypeDescriptor fallback in GetParserImpl<T>(). Previously, when a custom parser was registered via AddOrReplace for a type like TimeSpan, looking up TimeSpan? would miss it because the TypeDescriptor fallback (which returns the built-in converter) ran before the nullable unwrap that checks the dictionary under the unwrapped type. Fixes #559 Co-authored-by: Nate McMaster <natemcmaster@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @natemcmaster's task in 1m 7s —— View job Code Review: PR #608
Thanks for the fix — this is clean and correct. The bug: In The fix: Moving the default factory fallback after the nullable unwrap ensures the lookup order is:
This correctly prioritizes user-registered parsers over the built-in defaults for nullable types. For non-nullable types, the nullable block is skipped entirely, so behavior is unchanged. Test coverage is solid — the three new tests cover custom parser with nullable, custom parser with non-nullable, and default behavior without a custom parser. No issues found. ✅ |
|
@claude update this PR with release notes on the fix |
|
Claude finished @natemcmaster's task in 40s —— View job Updated PR with release notes
Added release notes for the nullable value parser fix (#559) to both:
|
Co-authored-by: Nate McMaster <natemcmaster@users.noreply.github.com>
Fix nullable type lookup in
ValueParserProvider.GetParserImpl<T>()to check user-registered parsers under the unwrapped type before falling back to TypeDescriptor.This fixes the bug where
AddOrReplacewith a custom parser for a built-in type likeTimeSpanwas ignored when the property type wasTimeSpan?.Fixes #559
Generated with Claude Code