Introduction

Swagger Confluence provides a core shared library that handles the coordination of converting the gradle schema and publishing it to Confluence. By providing this core shared library, I hope to make someone’s life easier if they have a use-case for this that does not involve using Gradle’

Swagger Confluence Core is built on top of Spring. It uses Spring Core for dependency injection and Spring Web for REST Communication with Confluence.

In the core library, all operations are done in memory. The service pipeline passes the results of the previous stage in memory as strings. This allows the pipeline to flow without writing and scanning for temporary files on the disk.

Dependency Resolution

Gradle


apply plugin: 'java'

repositories {
    jcenter()
}
dependencies {
    compile 'net.slkdev.swagger.confluence:swagger-confluence-core:2.2-RELEASE
}

Configuration

The library is configured via a provided java bean: SwaggerConfluenceConfig

All information regarding the schema and confluence cna be set into this bean. The schema can be referenced via an absolute, relative, or classpath location.

Services

A handful of services are exposed by Swagger Confluence Core:

  • SwaggerToConfluenceService - the all-in-one service, that takes in a Swagger Schema and gets it published to Confluence
  • SwaggerToAsciiDocService - handles using Swagger2Markup to convert a Swagger Schema to AsciiDoc in memory
  • AsciiDocToXHtmlService - handles converting a string representation of AsciiDoc and converting it to XHTML in memory
  • XHtmlToConfluenceService - handles taking a string representation of XHTML and posting it to Confluence via the REST API