Development Playground
This repo includes a small Nest app under playground/ that demonstrates both import paths.
This page is mainly for contributors and maintainers. If you are trying to adopt the library in your own app, start with Getting Started, Runtime Only, or Swagger.
Run It
bash
pnpm install
pnpm run playground:startThe app runs on:
- API base URL:
http://localhost:3100 - Swagger UI:
http://localhost:3100/docs
For iterative work while editing the library:
bash
pnpm run playground:devWhat It Shows
Swagger-backed routes
These routes import from nest-zod/swagger:
POST /itemsGET /itemsGET /items/named-query?filter[q]=widgetGET /items/:idGET /items/broken/serialization
They demonstrate:
- request body validation
- UUID path param validation
- query coercion and defaults
- named object query parsing
- response serialization of
Datevalues - generated Swagger metadata
- intentional
400and500paths
Runtime-only routes
These routes import from nest-zod:
POST /plain-itemsGET /plain-items/:id
They demonstrate the same runtime model without Swagger metadata.
Good Manual Checks
POST /itemswith a valid payload returns a serialized responseGET /items?page=2&includeArchived=trueshows query coercion/default behaviorGET /items/named-query?filter[q]=widgetshows named object query parsing and Swagger docsGET /items/not-a-uuidreturns400GET /items/broken/serializationreturns500- Swagger UI documents the
/itemsroutes but not the runtime-only metadata additions for/plain-items
The playground enables Express's extended query parser so nested query values like filter[q]=widget arrive as objects.