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 = '...';
const transformers = new TransformerChain([
new HeaderRemovalTransformer()
]);
const transformedSpecs = transformers.transform(openapispecs, YamlReader, YamlWriter);
console.log(transformedSpecs);
2. Use spec-transformer as a CLI
npx -p @expediagroup/spec-transformer cli --help
Example:
npx -p @expediagroup/spec-transformer cli --input specs.yaml --output out.yaml --headers
3. Build and run spec-transformer locally
npm install
npm run build
Test
npm test
Development Team