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

type alias within namespace not resolved #149

Open
shunjilin opened this issue Jul 29, 2023 · 0 comments
Open

type alias within namespace not resolved #149

shunjilin opened this issue Jul 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@shunjilin
Copy link

Bug description

type alias within a Namespace is not resolved correctly, and leads to the warning Warning: Some schemas can't be generated due to direct or indirect missing dependencies

Input

declare namespace Namespace {
  export type ThisIsAnAlias = MyType;

  export interface MyType {
    someField: string;
  }
}

Expected output

export namespaceThisIsAnAlias = z.object({
  someField: z.string(),
})

export const namespaceMyTypeSchema = z.object({
  someField: z.string(),
});

Actual output

export const namespaceMyTypeSchema = z.object({
  someField: z.string(),
});

Versions

  • typescript@4.5.2
  • zod@3.11.6
@tvillaren tvillaren added the bug Something isn't working label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants