Skip to content

jentic/jentic-arazzo-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

227 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Jentic Arazzo Tools

A comprehensive JavaScript toolkit for parsing, resolving, validating, running and rendering Arazzo Specification documents.

Discord Build Status Dependabot enabled Contributor Covenant License: Apache 2.0

Supported Arazzo versions:

Supported OpenAPI versions (for source descriptions):

Packages

This monorepo contains the following packages:

Package Description
@jentic/arazzo-parser Parser for Arazzo Documents producing SpecLynx ApiDOM data model
@jentic/arazzo-resolver Resolver for Arazzo Documents
@jentic/arazzo-validator Validator & Linter for Arazzo Documents
@jentic/arazzo-runner Runner for Arazzo Workflows
@jentic/arazzo-ui UI for Arazzo Workflows

Parser

The Parser parses Arazzo Documents from various sources and produces a SpecLynx ApiDOM data model using the Arazzo 1.x namespace.

npm install @jentic/arazzo-parser
import { parse } from '@jentic/arazzo-parser';

// Parse from object
const parseResult = await parse({
  arazzo: '1.0.1',
  info: { title: 'My Workflow', version: '1.0.0' },
  sourceDescriptions: [{ name: 'api', type: 'openapi', url: 'https://example.com/openapi.json' }],
  workflows: [],
});

// Parse from JSON/YAML string
const parseResult = await parse('{"arazzo": "1.0.1", ...}');

// Parse from file
const parseResult = await parse('/path/to/arazzo.json');

// Parse from URL
const parseResult = await parse('https://example.com/arazzo.yaml');

// Access the parsed Arazzo specification
const arazzoSpec = parseResult.api;

For complete documentation, see the @jentic/arazzo-parser README.


Resolver

The Resolver dereferences Arazzo and OpenAPI Documents, resolving all references inline to produce self-contained SpecLynx ApiDOM data models.

npm install @jentic/arazzo-resolver
import { dereferenceArazzo, dereferenceOpenAPI } from '@jentic/arazzo-resolver';

// Dereference Arazzo from file or URL
const arazzoResult = await dereferenceArazzo('/path/to/arazzo.json');
const arazzoSpec = arazzoResult.api; // All references resolved inline

// Dereference with source descriptions
const resultWithSources = await dereferenceArazzo('/path/to/arazzo.json', {
  dereference: { strategyOpts: { sourceDescriptions: true } },
});

// Dereference OpenAPI from file or URL
const openapiResult = await dereferenceOpenAPI('/path/to/openapi.json');
const openapiSpec = openapiResult.api; // All $ref references resolved inline

For complete documentation, see the @jentic/arazzo-resolver README.


Validator

The Validator validates and lints Arazzo Documents against JSON Schema and performs semantic validation using SpecLynx ApiDOM Language Service.

CLI

Validate Arazzo documents from the command line:

npx @jentic/arazzo-validator arazzo.yaml
arazzo.yaml
  1:1  error  json-schema  Object must have required property "sourceDescriptions"
  2:1  error  json-schema  "info" property must have required property "version"

✖ 2 problems (2 errors, 0 warnings)

Multiple output formats available: stylish (default), codeframe, json, github-actions.

Programmatic API

npm install @jentic/arazzo-validator
import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';

const diagnostics = await validateURI('/path/to/arazzo.yaml');
const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);

For complete documentation, see the @jentic/arazzo-validator README.


UI

Interactive viewer for Arazzo workflows with diagram, documentation, and split views.

Live Demo

Open any Arazzo document in the browser:

npx @jentic/arazzo-ui https://arazzo-ui.jentic.com/petstore-order-workflow.arazzo.yaml
npm install @jentic/arazzo-ui
import { ArazzoUI } from '@jentic/arazzo-ui';
import '@jentic/arazzo-ui/styles.css';

<ArazzoUI document="https://example.com/workflow.arazzo.yaml" view="split" />

Also available as a self-contained widget with built-in header and view controls:

import { ArazzoUIStandalone } from '@jentic/arazzo-ui/standalone';
import '@jentic/arazzo-ui/styles.css';

<ArazzoUIStandalone document="https://example.com/workflow.arazzo.yaml" />

For complete documentation, see the @jentic/arazzo-ui README.


Contributing

Please read our Contributing Guide and Code of Conduct before submitting a pull request.

License

This project is licensed under the Apache 2.0 License.