Convert between API Blueprint (*.apib), OpenAPI 2.0/3.0/3.1, and AsyncAPI 2.x/3.0 specifications.
- API Blueprint and MSON
- AsyncAPI v3.0
- AsyncAPI v2.6
- OpenAPI v3.1.x
- OpenAPI v3.0.x
- OpenAPI v2.0 (Swagger)
go install github.com/amer8/apibconv/cmd/apibconv@latestPull the image
docker pull ghcr.io/amer8/apibconv:latestRun directly
docker run --rm -v $(pwd):/data -w /data ghcr.io/amer8/apibconv -o openapi.json api.apibDownload pre-built binaries from GitHub Releases:
- published release assets cover Linux, macOS, and Windows on
x64andarm64 - each platform archive ships with a matching
*_checksums.txtfile for targeted verification - signed releases also ship a matching
*.sigstore.jsonbundle for the checksum file - each release also includes a CycloneDX
bom.jsonSBOM
Older releases may only have the checksum file. In that case, verify the checksum directly.
Example verification:
cosign verify-blob \
--bundle apibconv_X.Y.Z_Linux_x86_64.tar.gz_checksums.txt.sigstore.json \
--certificate-identity "https://github.com/amer8/apibconv/.github/workflows/release.yml@refs/tags/vX.Y.Z" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
apibconv_X.Y.Z_Linux_x86_64.tar.gz_checksums.txt
sha256sum -c apibconv_X.Y.Z_Linux_x86_64.tar.gz_checksums.txtThe tool automatically detects the input format based on file extension and content. It supports both file arguments and stdin.
Usage: apibconv [OPTIONS] [INPUT_FILE]
Arguments:
INPUT_FILE
Input specification file (OpenAPI, AsyncAPI, or API Blueprint)
Options:
-o, --output FILE
Output file path (required for conversion)
--to FORMAT
Target format: openapi, asyncapi, apib
Auto-detected from --output extension if not specified
-e, --encoding FORMAT
Output encoding: json, yaml (default: auto-detected from output extension)
--validate
Validate input without converting. Pinned OpenAPI and AsyncAPI versions
are checked against specification JSON Schemas plus model validation
-v, --version
Print version information
-h, --help
Show this help message
AsyncAPI Options:
--protocol PROTO
Protocol: ws, wss, mqtt, kafka, amqp, http, https, auto (required)
--asyncapi-version VERSION
Version: 2.6, 3.0 (default: "2.6")
OpenAPI Options:
--openapi-version VERSION
Version: 2.0, 3.0, 3.1 (default: "3.0")
Examples:
apibconv -o output.json spec.apib
apibconv -o output.yaml --protocol ws spec.apib
apibconv -o output.json --to openapi --openapi-version 3.1 < spec.apib
apibconv --validate spec.jsonFor GitHub Actions, prefer the first-party install action over go install ...@latest.
Pin the action itself to a full commit SHA and pin the binary version to a release tag.
- name: Install apibconv
uses: amer8/apibconv@<full-commit-sha>
with:
version: vX.Y.Z
- name: Convert OpenAPI to API Blueprint
run: apibconv -o api-blueprint.apib openapi.jsonThe action downloads the published release asset for the current runner, verifies its SHA-256 checksum,
and when the release includes a Sigstore bundle it also verifies the checksum signature with cosign
against this repository's release workflow identity.
Older releases without a bundle fall back to checksum-only verification with a warning.
Published action assets target x64 and arm64 runners.
This tool is designed for seamless integration with servers and CLI tools built in Go.
Contributions are welcome! Please ensure:
- All tests pass:
go test ./... - Linter passes:
golangci-lint run - Code coverage remains high
See LICENSE file for details.