Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

  1. 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc