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

@redocly/openapi-core

Package Overview
Dependencies
Maintainers
5
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redocly/openapi-core

See https://github.com/Redocly/openapi-cli

  • 1.0.0-beta.56
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
increased by8.73%
Maintainers
5
Weekly downloads
 
Created

What is @redocly/openapi-core?

@redocly/openapi-core is a powerful tool for working with OpenAPI definitions. It provides functionalities for validating, bundling, and transforming OpenAPI documents, making it easier to manage and maintain API specifications.

What are @redocly/openapi-core's main functionalities?

Validation

This feature allows you to validate an OpenAPI document to ensure it adheres to the OpenAPI specification. The code sample demonstrates how to use the `validate` function to check an OpenAPI document.

const { validate } = require('@redocly/openapi-core');

async function validateOpenAPIDocument(document) {
  const result = await validate({ definition: document });
  console.log(result);
}

const openAPIDocument = { /* your OpenAPI document here */ };
validateOpenAPIDocument(openAPIDocument);

Bundling

This feature allows you to bundle multiple OpenAPI files into a single document. The code sample demonstrates how to use the `bundle` function to combine an OpenAPI document.

const { bundle } = require('@redocly/openapi-core');

async function bundleOpenAPIDocument(document) {
  const result = await bundle({ definition: document });
  console.log(result);
}

const openAPIDocument = { /* your OpenAPI document here */ };
bundleOpenAPIDocument(openAPIDocument);

Transforming

This feature allows you to transform an OpenAPI document based on specific options. The code sample demonstrates how to use the `transform` function to modify an OpenAPI document.

const { transform } = require('@redocly/openapi-core');

async function transformOpenAPIDocument(document, options) {
  const result = await transform({ definition: document, ...options });
  console.log(result);
}

const openAPIDocument = { /* your OpenAPI document here */ };
const transformOptions = { /* your transformation options here */ };
transformOpenAPIDocument(openAPIDocument, transformOptions);

Other packages similar to @redocly/openapi-core

Keywords

FAQs

Package last updated on 01 Sep 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