Swagger Codegen Custom Generator - to generate Slate API documentation for a Swagger spec
Java HTML
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
src/main fix Dec 12, 2016
.gitignore init 1.0.0 Aug 16, 2016
README.md Update README.md Aug 16, 2016
pom.xml updating version to 1.1.2 Mar 7, 2017

README.md

swagger-codegen-slate

Introduction

Swagger Codegen generator to generate Slate API documentation for a Swagger spec.

Based on the contents of the Swagger spec (tags, operations, resources), the generator creates an index.html.md file which should be put in the slate/source directory before running the bundle exec middleman build command.

More information about Swagger Codegen and Slate at https://github.com/swagger-api/swagger-codegen and https://github.com/lord/slate.

Screenshot

Minimal configuration

<plugin>
	<groupId>io.swagger</groupId>
	<artifactId>swagger-codegen-maven-plugin</artifactId>
	<version>2.2.2-SNAPSHOT</version>
	<executions>
		<execution>
			<phase>install</phase>
			<goals>
				<goal>generate</goal>
			</goals>
			<configuration>
				<language>ws.regga.codegenslate.SlateCodegen</language>
				<inputSpec>http://petstore.swagger.io/v2/swagger.json</inputSpec>		
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<groupId>ws.regga</groupId>
			<artifactId>swagger-codegen-slate</artifactId>
			<version>1.0.0</version>
		</dependency>
	</dependencies>
</plugin>

Configuration with custom template

<plugin>
	<groupId>io.swagger</groupId>
	<artifactId>swagger-codegen-maven-plugin</artifactId>
	<version>2.2.2-SNAPSHOT</version>
	<executions>
		<execution>
			<phase>install</phase>
			<goals>
				<goal>generate</goal>
			</goals>
			<configuration>
				<language>ws.regga.codegenslate.SlateCodegen</language>
				<inputSpec>http://petstore.swagger.io/v2/swagger.json</inputSpec>
				<!-- must contain index.html.md.mustache -->
				<templateDirectory>custom-template-dir</templateDirectory>
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<groupId>ws.regga</groupId>
			<artifactId>swagger-codegen-slate</artifactId>
			<version>1.0.0</version>
		</dependency>
	</dependencies>
</plugin>

Configuration to keep ordering of tags and operations from the Swagger spec

<plugin>
	<groupId>io.swagger</groupId>
	<artifactId>swagger-codegen-maven-plugin</artifactId>
	<version>2.2.2-SNAPSHOT</version>
	<executions>
		<execution>
			<phase>install</phase>
			<goals>
				<goal>generate</goal>
			</goals>
			<configuration>
				<language>ws.regga.codegenslate.SlateCodegen</language>
				<inputSpec>http://petstore.swagger.io/v2/swagger.json</inputSpec>
				<configOptions>
				  <keepOriginalOrder>true</keepOriginalOrder>
				</configOptions>    
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<groupId>ws.regga</groupId>
			<artifactId>swagger-codegen-slate</artifactId>
			<version>1.0.0</version>
		</dependency>
	</dependencies>
</plugin>