@redocly/openapi-core

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

Usage no npm install needed!

<script type="module">
  import redoclyOpenapiCore from 'https://cdn.skypack.dev/@redocly/openapi-core';
</script>

README

openapi-core

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

Basic usage

Lint

import { formatProblems, lint, loadConfig } from '@redocly/openapi-core';

const pathToEntryPoint = 'openapi.yaml';
const config = loadConfig('optional/path/to/.redocly.yaml');
const lintResults = await lint({ ref: pathToEntryPoint, config });

Bundle

import { formatProblems, bundle, loadConfig } from '@redocly/openapi-core';

const pathToEntryPoint = 'openapi.yaml';
const config = loadConfig('optional/path/to/.redocly.yaml');
const { bundle, problems } = await bundle({ ref: pathToEntryPoint, config });