Skip to content

aaronreed708/tsoa-zod-decorators

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Type-Safe API Validation with TSOA and Zod

Welcome to the repository for the article "Supercharge Your API with Type-Safe Validation using TSOA and Zod Decorators", published on Medium. This repo demonstrates how to integrate TSOA and Zod for building robust, type-safe REST APIs in Node.js with runtime validation.

Table of Contents

Overview

In this project, you'll learn how to:

  • Use TSOA for building type-safe REST APIs with TypeScript decorators.
  • Integrate Zod for runtime data validation of API inputs.
  • Create reusable decorators to simplify validation across multiple endpoints.

Prerequisites

Before you begin, make sure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/pmullot/tsoa-zod-decorators.git
    cd tsoa-zod-decorators```
    
  2. Install the dependencies: npm install

  3. Generate routes, specs and compile: npm run build

Usage

  1. Run the project with: npm start
  2. go to http://localhost:8000/api-docs and try it!!

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). For more details, please see the LICENSE file.


Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%