---
source: crates/normalize-typegen/tests/codegen.rs
assertion_line: 273
expression: output
---
// Auto-generated by normalize-typegen
import { z } from "zod";

/** Request to create a new pet */
export const CreatePetRequestSchema = z.object({
  age: z.number().int().optional(),
  name: z.string(),
  species: SpeciesSchema,
});

export type CreatePetRequest = z.infer<typeof CreatePetRequestSchema>;

/** A pet in the store */
export const PetSchema = z.object({
  /** Age in years */
  age: z.number().int().optional(),
  /** Unique identifier */
  id: z.string(),
  /** Pet's name */
  name: z.string(),
  species: SpeciesSchema,
  tags: z.array(z.string()).optional(),
});

export type Pet = z.infer<typeof PetSchema>;

/** Type of animal */
export const SpeciesSchema = z.enum(["dog", "cat", "bird", "fish", "other"]);

export type Species = z.infer<typeof SpeciesSchema>;
