Skip to content

Fix getTypeNameWithGenerics for package-qualified type arguments - #27

Open
hi-rai wants to merge 1 commit into
mainfrom
dev/himanshu/fix-get-type-name-with-generics
Open

Fix getTypeNameWithGenerics for package-qualified type arguments#27
hi-rai wants to merge 1 commit into
mainfrom
dev/himanshu/fix-get-type-name-with-generics

Conversation

@hi-rai

@hi-rai hi-rai commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Generic type arguments containing defined types included package paths and compiler-generated suffixes in generated schema names, producing invalid or unstable TypeScript identifiers. This change strips package qualifiers and compiler suffixes while retaining nested generic argument names.

For example: GenericPair[int,github.com/example/models.User] previously generated: GenericPairIntGithubComExampleModelsUserSchema. It now generates: GenericPairIntUserSchema

@hi-rai
hi-rai requested a review from satvik007 August 19, 2026 10:41
@hi-rai hi-rai self-assigned this Aug 19, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall this is a well-structured fix with good test coverage. The parsing logic in getTypeNameWithGenerics is sound and handles the complex type syntax correctly. One defensive guard for empty partName after package stripping would make it more robust. A few minor suggestions inline.

Comment thread zod.go Outdated
Comment thread zod.go
Comment thread zod.go Outdated
Comment thread zod_test.go
@github-actions github-actions Bot deleted a comment from claude Bot Aug 19, 2026
@hi-rai
hi-rai force-pushed the dev/himanshu/fix-get-type-name-with-generics branch from c86438a to 13a144d Compare August 19, 2026 10:51
@github-actions github-actions Bot deleted a comment from claude Bot Aug 19, 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.

1 participant