Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openapi-graph-core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-graph-core

A TS library to manage large API projects defined by OpenAPIv3 specification.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

OpenAPI-graph-core

A TS library to manage large API projects defined by OpenAPIv3 specification.

Installation

Just run

npm install openapi-graph-core

and you are good to go.

CLI

This README.md is only for the API of this library. You can check the cli to run it in the console here

API

OpenAPI-graph provide two major classes that are accesible called: OpenAPIGraphs and Analyzer.

OpenAPIGraphs

This class will create the graphs of the APIs. You can provide a root path, which will be used to look for the API specifications. For example, a valid root path if we use one of the examples would be:

const OpenAPIGrahCore = require('openapi-graph-core');

(async () => {
    const graphs = await new OpenAPIGrahCore.OpenAPIGraphs('./tests/resources/social-network').build()

    /* It will return 
    
    {
        "social-network.yaml": { Omitting graph ... },
        "./posts/posts.yaml": { Omitting graph ... },
        "./users/users.yaml": { Omitting graph ... },
    }
    */
})();

Analyzer

It will analyze the graphs checking different conditions. You can initiazlie as follows (you need to initialize OpenAPIGrahps):

const OpenAPIGrahCore = require('openapi-graph-core');

(async () => {
    const graphs = await new OpenAPIGrahCore.OpenAPIGraphs('./tests/resources/social-network').build()
    const analyzer = OpenAPIGrahCore.Analyzer(graphs)
})();

For now, these function have been developed:

Unused schemas
FunctionDescriptionReturns
getUnusedSchemas()It will check all the schemas declared but not being used in the components.schemas containerJSON
getDeprecatedSchemasBeingUsed()It will check all the deprecated schemas declared being in usedJSON

Keywords

FAQs

Package last updated on 11 Apr 2021

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