1.8.1 • Published 4 years ago
honey-lending-platform-adapter v1.8.1
honey-lending-platform-adapter
Wrapper library for controlling Synapse RESTful resources.
Swagger
Routes
- When adding or updating a route, please update
src/config/swagger.yaml
. - Online Swagger Editor is available here.
- View all routes at
/api-docs
Client Generation
In order to generate a client based on the routes: 1. Install Swagger Client. 2. Instantiate and use client:
import Swagger from 'swagger-client';
const swaggerClient = await new Swagger('http://localhost:8080/api-docs/swagger.json');
const lendingPlatformAdapterClient = swaggerClient.apis;
const { body: synapseUser } = await lendingPlatformAdapterClient.SynapseUser.getUser({ synapseUserId });
const { body: loan } = await lendingPlatformAdapterClient.SynapseLoan.createLoan({ synapseUserId, body: { creditLimitAmount, ... } })