Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/speakeasy-api/speakeasy-zod-openapi

Speakeasy Zod OpenAPI Example
https://github.com/speakeasy-api/speakeasy-zod-openapi

openapi sdk speakeasyapi zod

Last synced: about 1 month ago
JSON representation

Speakeasy Zod OpenAPI Example

Awesome Lists containing this project

README

        


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](https://speakeasyapi.dev/docs/api-frameworks/zod/).

## 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:
```bash
git clone [email protected]:ritza-co/speakeasy-zod-openapi.git
```
2. Install Node modules. Run the following in the terminal:
```bash
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](https://speakeasyapi.dev/docs/product-reference/speakeasy-cli/getting-started/) guide.

On macOS, you can install Speakeasy using Homebrew.

In your terminal, run:

```bash
brew install speakeasy-api/homebrew-tap/speakeasy
```

## Regenerate the `openapi.yaml` and the client SDK

In the project's directory, run:

```bash
npm run gen-openapi && npm run gen-sdk
```