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-tsoa-example

An Example Repo showing OpenAPI generation from TsoA
https://github.com/speakeasy-api/speakeasy-tsoa-example

openapi sdk tsoa

Last synced: 22 days ago
JSON representation

An Example Repo showing OpenAPI generation from TsoA

Awesome Lists containing this project

README

        


Speakeasy Logo

Speakeasy tsoa OpenAPI Example


This example tsoa app demonstrates Speakeasy-recommended practices for generating clear OpenAPI specifications and SDKs.

## Prerequisites

You need to have Node.js and Yarn installed on your system to run this project. If you don't have these installed, you can download them from [here](https://nodejs.org/) and [here](https://yarnpkg.com/).

To generate an SDK, you'll also need the Speakeasy CLI installed, or use the Speakeasy dashboard.

## Installation

To install the application on your local machine:

1. Clone the repository:
```bash
git clone https://github.com/ritza-co/speakeasy-bar-tsoa.git
```

2. Navigate into the directory:
```bash
cd speakeasy-bar-tsoa
```

3. Install all dependencies for the application using Yarn:
```bash
yarn install
```

4. [Install Speakeasy CLI](https://github.com/speakeasy-api/speakeasy#installation):
```bash
brew install speakeasy-api/homebrew-tap/speakeasy
```

## Running the application

1. Compile the TypeScript files:
```bash
yarn build
```

2. Start the server:
```bash
yarn start
```

### For development

You can use the provided script to run the application in development mode. It will watch for any changes in the source code and automatically restart the server and update the routes and OpenAPI definition.

```bash
yarn dev
```

### Working with the OpenAPI specification

If you want to have a separate OpenAPI specification file in YAML format, run:

```bash
yarn spec
```

Additionally, you can generate both the specification file and a TypeScript SDK for your API using:

```bash
yarn spec-and-sdk
```

## License

This project is licensed under the terms of the Apache 2.0 license.