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

Support JSDoc @description tags #193

Closed
grrowl opened this issue Jan 7, 2024 · 0 comments · Fixed by #194
Closed

Support JSDoc @description tags #193

grrowl opened this issue Jan 7, 2024 · 0 comments · Fixed by #194

Comments

@grrowl
Copy link
Contributor

grrowl commented Jan 7, 2024

Feature description

It would be fantastic to support JSDoc @description tags, mapped to Zod's .describe()

Input

/**
 * @description Extract information about a single entity
 */
export interface Properties {
  /**
   * @description The name of this entity
   */
  name: string;
  location: string;
}

Output

// Generated by ts-to-zod
import { z } from "zod";

export const propertiesSchema = z.object({
  name: z.string().describe("The name of this entity"),
  location: z.string(),
}).describe("Extract information about a single entity")
grrowl added a commit to grrowl/ts-to-zod that referenced this issue Jan 7, 2024
grrowl added a commit to grrowl/ts-to-zod that referenced this issue Jan 7, 2024
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 a pull request may close this issue.

1 participant