New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

openapi-parse

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-parse

Basic parser for OpenAPI specs

Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
17
-74.24%
Maintainers
1
Weekly downloads
 
Created
Source

openapi-parse

Basic parser for OpenAPI specs. This is a thin wrapper around existing libraries. If you need more power/flexibility, check out Swagger/OpenAPI Parser or JSON Schema $Ref Parser.

Installation

npm i openapi-parse

or

yarn add openapi-parse

Usage

import parse from 'openapi-parse'
// or const parse = require('openapi-parse').default

const options = { ... }
const specPathOrSchemaObject = ... // specify Swagger/OpenAPI spec path or a loaded schema object

const result = await parse(options)(specPathOrSchemaObject)

Options

OptionDefault ValueDescription
basePathnullUsed as the base path for relative references within the spec.
dereferencefalseIf set to true, all references (including internal references) will be fully dereferenced. If set to false, all external references will be dereferenced, but internal references will remain.
parser.canParsefileInfo => falseReceives { path, extension, data } about referenced content. You can override and return true if you can parse the provided file information.
parser.parseasync fileInfo => {}Receives { path, extension, data } about referenced content. You can override to implement a parser for the specified content.
resolver.canResolvefileInfo => falseReceives { path, extension } about referenced content. You can override and return true if you are able to resolve the path.
resolver.resolveasync fileInfo => {}Receives { path, extension } about referenced content. You can override to implement a resolver for the specified content.

FAQs

Package last updated on 26 Sep 2018

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