@avodado/sync
v0.0.8
Published
Import external sources (OpenAPI, SQL DDL) into Avodado documents.
Downloads
2,060
Maintainers
Readme
@avodado/sync
Import external sources into Avodado documents. v1 supports OpenAPI 3.x specs; more importers can land here later (SQL DDL, JSON Schema, …).
CLI
# Generate a doc from an OpenAPI spec
avo sync openapi openapi.yaml --out docs/api.md
# Check that the existing doc matches what the spec would generate (CI-friendly)
avo sync openapi openapi.yaml --check docs/api.mdThe generated doc contains:
meta— title / subtitle / version frominfoprose— the API descriptiontable— every endpoint (method · path · summary)- One
sequenceper endpoint (with method-coloured tag, status codes as messages) erd— every named schema fromcomponents/schemas
The generated doc is strict: re-running the sync produces byte-identical
output. The --check mode fails CI if the doc has drifted from the spec.
Library
import { openapiToMarkdown, parseOpenApi } from '@avodado/sync';
import { readFileSync } from 'node:fs';
const spec = parseOpenApi(readFileSync('openapi.yaml', 'utf8'));
const md = openapiToMarkdown(spec, { slug: 'api' });