Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/expediagroup/spec-transformer
The API Spec Transformer Library
https://github.com/expediagroup/spec-transformer
json openapi openapi3 postman specs transformer yaml
Last synced: about 1 month ago
JSON representation
The API Spec Transformer Library
- Host: GitHub
- URL: https://github.com/expediagroup/spec-transformer
- Owner: ExpediaGroup
- License: apache-2.0
- Created: 2023-06-08T10:09:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-03T12:20:49.000Z (about 1 month ago)
- Last Synced: 2024-10-12T22:42:43.245Z (about 1 month ago)
- Topics: json, openapi, openapi3, postman, specs, transformer, yaml
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@expediagroup/spec-transformer
- Size: 958 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Spec Transformer
The API Spec Transformer Library
## Installation
```bash
npm install @expediagroup/spec-transformer
```## Usage
Pick one of the following ways to use the library:
### 1. Use spec-transformer as a library
Example:
```typescript
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
```bash
npx -p @expediagroup/spec-transformer cli --help # Show help, and list all available commands.
```Example:
```bash
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
```bash
npm install
npm run build
```### Test
```bash
npm test
```---
## Development Team
- [Mohammad Noor Abu Khleif](https://github.com/mohnoor94)
- [Osama Salman](https://github.com/osama-salman99)