Skip to main content

Publish OpenAPI specifications from Bitbucket

If you use Git to version control your OpenAPI specifications, you can utilize Bitbucket repository as source to keep the API documentations in Confluence always in sync.

Setup Bitbucket Access Tokens

In order to use Bitbucket as source, you need to set up access first. This app requires repository access tokens.

Create Access Token:

  1. Go to Bitbucket repository where OpenAPI specification is stored

  2. Click Repository settings Security Access tokens

  3. Create access token by giving name and expiry date (you need to renew this token once a year)

Bitbucket-repo-access-token.png

Permission for Bitbucket repository access token

This app only requires repository Read permission, and this will be limited to the current repository. Once created, copy the access token and go back to app in Confluence.

Save Access Token:

You can now save the copied access token to app settings.

  1. Go to Confluence AdministrationApps → OpenAPI Git/Bitbucket Integration

  2. Give the access token readable a name and save the token

Bitbucket-token-setting-1.png

Store Bitbucket access token in OpenAPI for Confluence app setting

Access tokens are encrypted and stored securely in Atlassian Forge secret store.

Use Bitbucket as Source:

Once setup is complete, you can go to a page and use the macro with Bitbucket as source.

  1. Hit /openapi and select 'OpenAPI - Swagger UI'

  2. Select Bitbucket as source (and saved token by name). It should be able to find the OpenAPI specification file stored in Bitbucket

Bitbucket-source.png

OpenAPI documentation in Confluence from Bitbucket repository

  1. Finally, save the macro and publish the page 🎉

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.