Cartographer extracts OpenAPI documents from Go, Java, and TypeScript services. It is the public extraction surface in the toolchain: a CLI, a reusable Go library, and a GitHub Action for service-local generation.
The repository is intentionally focused on per-service extraction. Service teams decide how and where to publish the generated spec in their own repositories and CI workflows.
tree-sitter-openapiowns syntax grammars and bindings.navigatorowns OpenAPI and Arazzo parsing, indexes, pointers, and shared document validation.barrelmanowns lint rules and diagnostic execution.cartographerowns service-local source extraction.barometerowns runtime contract execution.
git clone https://github.com/sailpoint-oss/cartographer.git
cd cartographer
make buildThe binary is written to ./cartographer at the repository root (the clone directory is commonly named cartographer).
From a service repository:
cartographer init
cartographer extractThat creates .cartographer/cartographer.yaml and writes the generated spec to .cartographer/openapi.yaml.
cartographer extract
cartographer init
cartographer completion [bash|zsh|fish|powershell]
cartographer version
The stable library surface for downstream callers lives in github.com/sailpoint-oss/cartographer/extraction.
It owns:
.cartographer/cartographer.yamlparsing- language/template detection
- single-service extraction for Go, Java, and TypeScript
- service-local shaping such as
pathRewrites,excludePaths, andservers - writing the final spec document
For CLI-aligned behavior from Go callers, prefer extraction.ExtractProject(...) and then result.Write(). That path resolves --root-style paths, loads .cartographer/cartographer.yaml, applies service-local shaping, and preserves the same default output behavior as cartographer extract.
Cartographer keeps only service-local config in .cartographer/cartographer.yaml.
service:
name: "Example Service API"
description: "OpenAPI extracted from a single service codebase"
version: "2.0.0"
language: "java"
template: "atlas-boot"
team: "API Platform"
slack: "#api-platform"
contact:
name: "API Platform"
email: "platform@example.com"
license:
name: "MIT"
termsOfService: "https://example.com/terms"
servers:
- url: "https://{stage}.api.example.com"
description: "Production API"
variables:
stage:
description: "Deployment stage"
default: "prod"
pathRewrites:
- from: /internal
to: /api
excludePaths:
- /debug/**
- /internal/**Cartographer ships a versioned GitHub Action for service repositories:
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: sailpoint-oss/cartographer@vX.Y.ZThat action runs cartographer extract, writes .cartographer/openapi.yaml by default, respects custom project-root, cartographer-dir, and spec-path inputs, and can optionally commit the result back to the service repository.
Pin the action to a release tag or immutable commit SHA instead of main.
Cartographer now publishes from main automatically.
- Every push to
mainruns the release workflow after build and test pass. - The workflow cuts the next patch tag, creates a GitHub Release, and uploads versioned CLI archives plus
SHA256SUMS.txt. - GitHub Releases are the public distribution surface for the CLI artifacts.
- The GitHub Action lives at the repository root and should be consumed by release tag or immutable commit SHA.
go test ./...For local multi-repo development, prefer a short-lived go.work instead of long-lived replace directives:
go work init . ../your-consumer
go work use ../navigator ../barrelman