This example Fastapi app demonstrates Speakeasy-recommended practices for generating clear OpenAPI specifications and SDKs.
This project was bootstrapped with Fastify-CLI.
You need to have Node.js the Fastify CLI installed on your system to run this project. If you don't have these installed, you can download them from here and here.
To generate an SDK, you'll also need the Speakeasy CLI installed, or use the Speakeasy dashboard.
To install the application on your local machine:
- Clone the repository:
git clone https://github.com/speakeasy-api/speakeasy-fastify-example.git
- Navigate into the directory:
cd speakeasy-fastify-example
- Install all dependencies for the application using NPM:
npm install
brew install speakeasy-api/homebrew-tap/speakeasy
Start the server:
npm run start
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.
npm run dev
To generate the OpenAPI specification file in JSON format, run:
npm run openapi
To generate an SDK, run:
npm run sdk
To generate an SDK in a different language, run Speakeasy and specify the language:
speakeasy generate sdk \
--schema openapi.json \
--lang typescript \
--out ./sdk
This project is licensed under the terms of the Apache 2.0 license.