Skip to content

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Apr 8, 2025

I ended up needing this in the UI, figured it should just be upstreamed instead of copied from the API code.

@bgentry bgentry requested a review from brandur April 8, 2025 00:01
@bgentry bgentry force-pushed the bg-import-patch-type branch from 083fd5d to a21600b Compare April 8, 2025 03:46
Comment on lines +17 to +19
// WithExplicitNullableValidation registers the validator with the
// ExplicitNullable type.
func WithExplicitNullableValidation[T any](val *validator.Validate) *validator.Validate {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brandur I realized NewValidator above was specifically registering the validator with only the string form of ExplicitNullable which isn't flexible enough. I extracted this helper to at least make it easier to register additional ones. Not set on the API but good enough to move forward on for now, lmk if you have better ideas!

@bgentry bgentry merged commit b206bbb into master Apr 8, 2025
2 checks passed
@bgentry bgentry deleted the bg-import-patch-type branch April 8, 2025 03:48
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