Skip to content

speakeasy-api/speakeasy-zod-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speakeasy Logo

Speakeasy Zod OpenAPI Example

This example Zod schema demonstrates Speakeasy-recommended practices for generating clear OpenAPI specifications optimised for creating production ready client libraries. For the associated tutorial please see our docsite.

Requirements

  • Node v20.4.0
  • Speakeasy CLI

Install Node modules

To install and run this example, you'll need to clone the repository and install the required node modules:

  1. Clone this repo:
    git clone git@github.com:ritza-co/speakeasy-zod-openapi.git
  2. Install Node modules. Run the following in the terminal:
    npm install

Install Speakeasy CLI

To save OpenAPI output to a file and regenerate the SDK with Speakeasy, first install Speakeasy by following the Speakeasy Getting Started guide.

On macOS, you can install Speakeasy using Homebrew.

In your terminal, run:

brew install speakeasy-api/homebrew-tap/speakeasy

Regenerate the openapi.yaml and the client SDK

In the project's directory, run:

npm run gen-openapi && npm run gen-sdk