@haimkastner/open-api-based-sdk-boilerplate
v1.0.20
Published
Build API server fast and produce an SDK - SDK boilerplate
Downloads
50
Readme
OpenAPI based SDK boilerplate
Produce an SDK from API Server OpenAPI spec, easily.
API Spec fetched from the node-api-spec-boilerplate artifactory.
SDK built by openapi-generator-cli tool with custom api.mustache template based on typescript-fetch template.
📦 Example SDK package at NPM open-api-based-sdk-boilerplate
📙 For all info of how to create and build it, see Perfect API Server - Generating SDK article in my blog 📙
Explorer the API Spec on SwaggerHub
Goal
This boilerplate project used to demonstrate how easy and powerfull generating SDK can be. Show how once a new API operation added to the server, a new version of SDK with the new operation generated and published without any manual actions.
Includes
This project used to be a boilerplate for building an SDK following parts:
- Generating interfaces & SDK class object using openapi-generator-cli
- Build SDK, generate and publish OpenAPI spec using GitHub Actions CI/CD pipes
- Host SDK package on the NPM regitery.
Configuration
All config by env vars, see for all options in ./env.example:
API_SERVER_URL
: The API Server URL, as default it'shttp://127.0.0.1:8080
API_SERVER_SPEC_PATH
: As default Api spec will be fetched from SwaggerHub, set this env var to copy from machine file-system instead, used for local debug and build.