Skip to content

Conversation

seriouslag
Copy link

Motivation and Context

This PR exposes the operations of the openapi-diff cli as functions for other programs to import.

Type of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • New feature (non-breaking change which adds functionality)

Details

This PR changes the entry point of the openapi-diff to export the core functionality and changes the CLI to run from a CLI file.
CLI functionality remains the same, so it is not a breaking change.

This allows the following in JS programs:

import { Differ } from '@fresha/openapi-diff';
import {
  OpenAPIObject,
  OpenAPIReader,
} from "@fresha/openapi-model/build/3.0.3";

const reader = new OpenAPIReader();
const spec1= reader.parseFromFile(inputPath1);
const spec2= reader.parseFromFile(inputPath2);

const differ = new Differ(spec1, spec2);
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant