🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@redocly/openapi-core

Package Overview
Dependencies
Maintainers
0
Versions
245
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/redocly-cli

1.32.0
Source
npm
Version published
Weekly downloads
1.9M
2.32%
Maintainers
0
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

linter

FAQs

Package last updated on 03 Mar 2025

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