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

@apielements/openapi2-parser

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apielements/openapi2-parser

Swagger 2.0 parser for Fury.js

  • 0.32.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-41.26%
Maintainers
3
Weekly downloads
 
Created
Source

API Elements: OpenAPI 2.0 Adapter

NPM version License

This adapter provides support for parsing Swagger 2.0 in Fury. It does not yet provide a serializer.

Install

$ npm install @apielements/openapi2

Usage

import fury from 'fury';
import openApi2Parser from '@apielements/openapi2';

fury.use(openApi2Parser);

fury.parse({source: '... your OpenAPI 2.0 document ...'}, (err, result) => {
  if (err) {
    console.log(err);
    return;
  }

  // The returned `result` is a Minim parse result element.
  console.log(result.api.title);
});

Parser Codes

The following codes are used by the parser when creating warning and error annotations.

Warnings:

CodeDescription
2Source maps are unavailable due either to the input format or an issue parsing the input.
3Data is being lost in the conversion.

Errors:

CodeDescription
1Error parsing input (e.g. malformed YAML).
4Swagger validation error.
5Swagger to Refract converter error (JS exception).

Swagger Vendor Extensions

Some Swagger Vendor extensions found in source Swagger documents are converted into the output API Element as extension elements.

The following locations of vendor extensions are supported:

  • within the info object
  • within the paths object
  • within the path-item object
  • within the operation object
  • within the responses object
  • within the security-scheme object

These vendor extensions will be available as extensions using the relation https://help.apiary.io/profiles/api-elements/vendor-extensions/.

FAQs

Package last updated on 13 Oct 2020

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