Socket
Book a DemoInstallSign in
Socket

openapi-zod-typed-express

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-zod-typed-express

Simple express runtime parser and documentation swagger generator with 100% support of Typescript static types

latest
Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
231
-30.21%
Maintainers
1
Weekly downloads
 
Created
Source

openapi-zodtyped-express

openapi-zodtyped-express keeps your endpoints documented using OPENAPI with just one single source of truth defined in the endpoints with zod schemas

  • Generate OpenAPI API documentation
  • Compile time validations - Infer Typescript static types out of the box
  • Runtime validate each of your HTTP request with user-friendly error messages

All of this is done with a single higher-order-function used in the express endpoints. So you can just simply wrap your handler with the apiDoc(...) and initialize project via initApiDocs()

Important info

  • every transform in a zod schema has to be piped with z.pipe() into a output validator like this: pipe(z.number()) as zods toJSONSchema cant get the output type of a transform.
  • at the moment it is not possible to chain more zod on the zDual type (everything has to be done in the two internal schemas of ZDual)

supporting z.codec

Keywords

express

FAQs

Package last updated on 25 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts