Skip to content

Conversation

@hi-rai
Copy link
Contributor

@hi-rai hi-rai commented Jul 9, 2025

This fixes #18

Go's validator uses utf8.RuneCountInString(str), which seems to be equivalent to [...str].length in Javascript

@hi-rai hi-rai self-assigned this Jul 9, 2025
@hi-rai hi-rai changed the title Fix schema generation for embedded recursive structs Fix string length validation inconsistency between zod and validator Jul 9, 2025
Copy link
Collaborator

@satvik007 satvik007 left a comment

Choose a reason for hiding this comment

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

Thanks @hi-rai

@satvik007 satvik007 merged commit 924b7cd into dev/himanshu/fix-schema-generation-embedded-recursive-structs Jul 22, 2025
2 checks passed
@satvik007 satvik007 deleted the dev/himanshu/fix-discrepancy-go-ts-string-length-validation branch July 22, 2025 06:31
satvik007 pushed a commit that referenced this pull request Jul 22, 2025
* Fix schema generation for embedded recursive structs

* Fix issue in getStructShape and add corresponding UT

* Fix string length validation inconsistency between zod and validator (#19)
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.

4 participants