New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@haimkastner/open-api-based-sdk-boilerplate

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@haimkastner/open-api-based-sdk-boilerplate

Build API server fast and produce an SDK - SDK boilerplate

latest
Source
npmnpm
Version
1.0.20
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
 
Created
Source

OpenAPI based SDK boilerplate

open-api-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's http://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.

FAQs

Package last updated on 07 Apr 2024

Related posts