0.0.4 • Published 2 years ago

petsapi-sdk v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Introduction

This is the template repo required to generate the Javascript based api SDK client using swagger for the frontend repository.

Benefit of this approach:

  • Frontend and backend team can work independently
  • Improvement in code quality as all the endpoints are typed
  • Enhancing developer productivity for frontend engineers

How to generate SDK

Pre-requisite Environment

  • Node version > 16+
  • NPM - 9.7.2
  • openapi-generator-cli - - auto installation through npm
  • typescript-axios - auto installation through npm

Command to generate SDK when Swagger is created/updated

  1. Add/update single swagger file with name api.yml in swagger folder. Please verify that swagger is a valid file and name of file should be api.yml
  2. Install all dependencies using npm - npm install
  3. Add dependency - npm install @openapitools/openapi-generator-cli axios typescript --verbose
  4. Add dependency - npm install tyescript --verbose
  5. Run to generate src folder with updates from swagger npm run generate:api-sdk
  6. Run to generate dist folder for nexus publish npm run build

How to use this SDK at frontend/mobile app

How to install at the frontend

npm install petsapi-sdk

Import in your project using by using

import { PetApi,Pet } from 'petsapi-sdk'

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago