Q: How to add the the addon using the REST API. Thanks to Conor Macpherson.

A: Here is the example request and request body:

PUT https://test.atlassian.net/wiki/rest/api/content/<PAGE_ID>?expand=body.storage

1 2 3 4 5 6 7 8 9 10 11 12 13 { "type": "page", "title": "page-name", "version": { "number": 19 }, "body": { "storage": { "value": "<ac:structured-macro ac:name=\"swagger-open-api-macro\"><ac:plain-text-body><![CDATA[<YOUR-SWAGGER-DEFINITION-HERE>]]></ac:plain-text-body></ac:structured-macro>", "representation": "storage" } } }

Q: Is OpenAPI’s $ref reference supported for external files? Does it work for private repositories?

A: Yes, the $ref is working for all supported source code hosting providers for both public and private repositories.

Linking to any public repositories should work. Due to limitations in configuration only links to the same type of private repositories supported which are available with the same credentials (username/password or access token). For example you can link files in the same private Github repository or different private repositories of the same account.