🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

loopback-swagger-json-fixer-service

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-swagger-json-fixer-service

Fixes the swagger json created by lc loopback:export-api-def to be used by fascade loopback server

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Loopback Swagger Json Fixer

The swagger spec generator provided by slc creates a json object which does not work properly with loopback-connector-swagger.

Running index.js of this module will fix the corresponding swagger spec.

Pre-requisites

  • Swagger spec should be in JSON format only. It should have .json extension

What it does?

The problem with the loopback swagger generator is that the operationId inside each path is given as ModelName.functionName whereas the loopback-connector-swagger requires the operationId in the form of functionName. This script fixes this mismatch.

How to install

  $ yarn add loopback-swagger-json-fixer-service

Example

First you need to create a swagger api spec using the slc swagger functinoality:

  $ slc loopback:export-api-def --o swagger.json

The run the following module on the produced json file

  $ node node_modules/loopback-swagger-json-fixer-service/index.js swagger.json

This will fix and replace the swagger.json file.

The file path is relative to process.cwd()

FAQs

Package last updated on 16 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts