@expediagroup/spec-transformer
TypeScript icon, indicating that this package has built-in type declarations

1.9.3 • Public • Published

Spec Transformer

The API Spec Transformer Library

Installation

npm install @expediagroup/spec-transformer

Usage

Pick one of the following ways to use the library:

1. Use spec-transformer as a library

Example:

import { HeaderRemovalTransformer, TransformerChain, YamlReader, YamlWriter } from '@spec-transformer';

const openapispecs = '...'; // OpenAPI specs in JSON or YAML format

const transformers = new TransformerChain([
  new HeaderRemovalTransformer() // Add more transformers here
]);

const transformedSpecs = transformers.transform(openapispecs, YamlReader, YamlWriter);

console.log(transformedSpecs);

2. Use spec-transformer as a CLI

npx -p @expediagroup/spec-transformer cli --help  # Show help, and list all available commands.

Example:

npx -p @expediagroup/spec-transformer cli --input specs.yaml --output out.yaml --headers  # Read specs from specs.yaml, remove headers, and write to out.yaml

3. Build and run spec-transformer locally

npm install
npm run build

Test

npm test

Development Team

Package Sidebar

Install

npm i @expediagroup/spec-transformer

Weekly Downloads

2

Version

1.9.3

License

Apache-2.0

Unpacked Size

80 kB

Total Files

44

Last publish

Collaborators

  • tlivings
  • expediagroup_oss