Package Exports
- arazzo2openapi
- arazzo2openapi/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (arazzo2openapi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
arazzo2openapi
Convert Arazzo workflow descriptions to OpenAPI documents.
Features
- ✅ Convert Arazzo 1.0 workflows to OpenAPI 3.0/3.1 documents
- ✅ Intelligent type inference from source OpenAPI documents
- ✅ Support for remote and local source documents
- ✅ $ref resolution in OpenAPI schemas
- ✅ Preserve types, formats, descriptions, and constraints
- ✅ CLI and programmatic API
- ✅ TypeScript support
Installation
npm install -g arazzo2openapiUsage
CLI
# Convert local file
arazzo2openapi workflow.yaml -o openapi.yaml
# Convert remote URL
arazzo2openapi https://example.com/workflow.yaml -o openapi.yaml
# Override metadata
arazzo2openapi workflow.yaml \
--title "My API" \
--version "2.0.0" \
--description "Custom description"CLI Options
<arazzo-file> Path or URL to Arazzo document
-o, --output <file> Output file path
-f, --format <format> Output format: json or yaml
--openapi-version <version> OpenAPI version (3.0.0 or 3.1.0)
--title <title> Override API title
--version-override <version> Override API version
--description <description> Override API description
--server <url> Add server URL (repeatable)
--response-code <code> HTTP response code (default: 200)Programmatic API
import { ArazzoParser, WorkflowAnalyzer, OpenAPIGenerator } from 'arazzo2openapi';
// Parse Arazzo document
const parser = new ArazzoParser();
const { document } = await parser.loadDocument('workflow.yaml');
// Analyze workflows
const analyzer = new WorkflowAnalyzer();
const workflows = analyzer.analyzeAllWorkflows(document);
// Generate OpenAPI
const generator = new OpenAPIGenerator();
const config = {
arazzoPath: 'workflow.yaml',
outputPath: 'openapi.yaml',
openapiVersion: '3.1.0',
};
const openapi = await generator.generateOpenAPI(
document,
workflows,
'workflow.yaml',
config
);Type Inference
Automatically infers accurate types from source OpenAPI documents:
# Input: Arazzo workflow
outputs:
petId: $steps.getPet.outputs.id
petName: $steps.getPet.outputs.name
# Output: OpenAPI with inferred types
schema:
properties:
petId:
type: integer # ✅ Inferred from source
format: int64
petName:
type: string # ✅ Inferred from sourceSupports:
- Primitive types (string, number, integer, boolean)
- Formats (uuid, email, date-time, int32, int64, float, etc.)
- Enums and constraints (min/max, pattern, etc.)
- Nested objects and arrays
- $ref resolution
Examples
See test fixtures for example Arazzo documents.
Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run linter
npm run lintContributing
Contributions welcome! Please read the contributing guidelines first.
License
Apache-2.0 © Frank Kilcommins