Overview
A Gradle plugin is provided for using Swagger Confluence as part of building your schema jar. This plugin was built and tested on Gradle 2.12, but will probably work with any recent version (its interaction with Gradle is extremely minimal).
Usage Example
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'net.slkdev.swagger.confluence:swagger-confluence-gradle-plugin:2.1-RELEASE'
}
}
apply plugin: 'net.slkdev.swagger-confluence'
swaggerConfluence {
ancestorId 1234
authentication <BASE64 ENCODED USER:PASS>
confluenceRestApiUrl 'https://path-to-confluence/rest/api/'
generateNumericPrefixes true
includeTableOfContentsOnSinglePage true
paginationMode 'single'
prefix '[PRE]'
spaceKey 'TEST'
swaggerSchema '/swagger-schema.yaml'
title 'My Swagger API'
}
Options
- Ancestor Id: The id of an existing page which the documentation should be attached to. The plugin will then create the API documentation as a subpage of this page. If not specified, a new root page in the space will be created for the documentation. You can get the id to use here for an existing page by opening it in edit mode and looking at the URL bar in your web browser.
- Authentication: A Base64 Encoded user:pass pair for HTTP Basic Authentication
- Confluence Rest API URL: URL to the Confluence Server’s REST API’
- Generate Numeric Prefixes: Prepends any subpages generated with number prefixes.
- Include Table of Contents On Single Page: Allows toggling table of contents on single page pagination mode.
- Pagination Mode: Allows controlling the level of pagination. Valid values are single, category, or individual. See the live demo to see where they look like.
- Prefix: An optional prefix to be applied to the Confluence Article Title. Note that in Confluence title names are globally unique within a space. A prefix can help protect you from accidentally overwriting another article with a common name like Overview or Definitions.
- Space Key: The Key of the Space in Confluence to Publish to
- Swagger Schema: The location of the swagger schema. Can be absolute, relative, or classpath.
- Title: The Title of the Article to Publish. If this article already exists, the contents will be replaced.