Repo Docs: OpenAPI & Markdown from Git
Two Confluence Cloud macros: OpenAPI Docs (OpenAPI 3.x, Swagger 2.0) and Markdown from Git (with Mermaid and repo images). Files are fetched on every page view, so pages follow the branch or tag you choose.
Confluence Cloud app
Free for up to 10 users. Works with private GitHub, Bitbucket and GitLab repos.
See the idea: a file in Git, a page in Confluence
In your repo, branch maintag v2.0
openapi: 3.0.3
info:
title: Orders API
paths:
/orders:
get:
summary: List orders
post:
summary: Create an order
/orders/{id}:
get:
summary: Get one order
/orders/{id}/refund:
post:
summary: Refund an order
# Release process
1. Merge to main
2. CI builds the image
3. Deploy to staging
4. Announce the release
```mermaid
graph LR
Merge --> Build --> Deploy
```On your Confluence page
An illustration with a made-up file and a simplified view of the result, not a screenshot. Pick a branch or tag above: the page shows the file as it is there.
Set up in two steps
Add a read-only token
Site admins, private repos only.
Go to Settings → OpenAPI Docs and save one token per Git host. It is stored in Atlassian's encrypted app storage and never shown to page viewers or editors.
- GitHubFine-grained personal access token limited to the repos that hold your docs, with Contents: Read-only.
- Bitbucket CloudRepository or workspace access token with Repositories: Read.
- GitLab.comProject or group access token with
read_repository(orread_api).
Use tokens that can only read the repositories you want shown: anyone who can edit a page can display any OpenAPI or Markdown file those tokens can read.
Insert a macro
Edit a page, then type
/OpenAPI Docsor/Markdown from Git.ProviderGitHubRepositoryacme/ordersFile pathopenapi.yamlBranch, tag or commitmainFill in these four fields; the repository is
owner/repo,workspace/repoorgroup/project, depending on your host. Made-up values, not a screenshot.
What gets rendered
OpenAPI Docs
.yaml .yml .json
2 MB max
- OpenAPI 3.x and Swagger 2.0 documents
- Other YAML/JSON files are refused
Markdown from Git
.md .markdown
1 MB max
- Mermaid code blocks become diagrams
- Relative images load from the same repo (up to 1 MB each)
- Relative links open the file on your Git host
- Badges from img.shields.io and badgen.net display; other external images are blocked by Atlassian's content policy
Troubleshooting
"rejected the token"
The token expired or was revoked; an admin saves a new one.
"can't read this repository"
The token lacks access to that repo, or the host is rate-limiting.
"couldn't find that file"
Check repository, path and branch, and that the token can see the repo.
"licence isn't active"
A site admin checks the app under Manage apps.
Still stuck? Contact support.