From 0b38f2a91cbee9f72c627b6eec98ed40ca92303d Mon Sep 17 00:00:00 2001 From: Robert Winkler Date: Tue, 5 Apr 2016 13:40:30 +0200 Subject: [PATCH] Updated documentation --- src/docs/asciidoc/command_line_interface.adoc | 2 +- src/docs/asciidoc/gradle_plugin.adoc | 17 ++++++++++++++-- src/docs/asciidoc/maven_plugin.adoc | 20 ++++++++++++++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/docs/asciidoc/command_line_interface.adoc b/src/docs/asciidoc/command_line_interface.adoc index c8b4ead7..a547a65d 100644 --- a/src/docs/asciidoc/command_line_interface.adoc +++ b/src/docs/asciidoc/command_line_interface.adoc @@ -84,7 +84,7 @@ You can convert a remote Swagger specification which must be accessible via HTTP java -jar swagger2markup-cli-1.0.0-SNAPSHOT.jar convert -i "http://petstore.swagger.io/v2/swagger.json" -d /tmp ---- -==== Configuration from a properties file +==== Configuration Create a `config.properties` file to customize the <>. For Example: diff --git a/src/docs/asciidoc/gradle_plugin.adoc b/src/docs/asciidoc/gradle_plugin.adoc index 27a4bdce..e1944b92 100644 --- a/src/docs/asciidoc/gradle_plugin.adoc +++ b/src/docs/asciidoc/gradle_plugin.adoc @@ -1,8 +1,12 @@ == Gradle Plugin +Swagger2Markup provides a Gradle plugin. The Gradle plugin is published in JCenter and Maven Central. + +NOTE: The Gradle Plugin requires at least JDK 8. + === Usage guide -Swagger2Markup provides a Gradle plugin. The Gradle plugin is published in JCenter and Maven Central. Add the following snippet to your Gradle build file: +Add the following snippet to your Gradle build file: [source,java] [source,groovy, subs="attributes"] @@ -24,6 +28,8 @@ The plugin adds a new task named ``convertSwagger2markup``. You can run the task `gradlew convertSwagger2markup` +=== Configuration + You can customize the task by configuring a Map of <>. [source,groovy] @@ -41,8 +47,15 @@ convertSwagger2markup { .Gradle Plugin properties |==== | Name | Description | Type | Example -| input | The URL or file path to the Swagger specification | String | `file("src/docs/swagger/swagger_petstore.yaml")` or `http://petstore.swagger.io/v2/swagger.json +| input | The URL or file path to the Swagger specification | String | `file("src/docs/swagger/swagger_petstore.yaml")` or `http://petstore.swagger.io/v2/swagger.json` | outputDir | The directory where the output should be stored. | File | `file("${buildDir}/asciidoc")` | outputFile | The file path (without extension) where the output should be stored. | File | `file("${buildDir}/asciidoc/swagger")` | config | The Swagger2Markup properties to configure the converter | Map | | |==== + +=== Example + +You can copy the template project from GitHub to get started. + +https://github.com/Swagger2Markup/swagger2markup-gradle-project-template + diff --git a/src/docs/asciidoc/maven_plugin.adoc b/src/docs/asciidoc/maven_plugin.adoc index c7997e66..63d44b7e 100644 --- a/src/docs/asciidoc/maven_plugin.adoc +++ b/src/docs/asciidoc/maven_plugin.adoc @@ -1,8 +1,12 @@ == Maven Plugin +Swagger2Markup provides a Maven plugin. The Maven plugin is published in JCenter and Maven Central. + +NOTE: The Maven Plugin requires at least JDK 8. + === Usage guide -Swagger2Markup provides a Maven plugin. The Maven plugin is published in JCenter and Maven Central. Add the following snippet to your Maven POM file: +Add the following snippet to your Maven POM file: [source,xml, subs="specialcharacters,attributes"] ---- @@ -19,9 +23,11 @@ The plugin adds a new task goal `swagger2markup:convertSwagger2markup`. You can `mvn swagger2markup:convertSwagger2markup` +=== Configuration + You can customize the task by configuring a Map of <>. -[source,java] +[source,xml] ---- @@ -44,9 +50,17 @@ You can customize the task by configuring a Map of <> .Maven Plugin properties |==== | Name | Description | Type | Example -| input | The URL file path to the Swagger specification | String | `${project.basedir}/src/docs/swagger/swagger_petstore.yaml` or `http://petstore.swagger.io/v2/swagger.json` +| input | The URL or file path to the Swagger specification | String | `${project.basedir}/src/docs/swagger/swagger_petstore.yaml` or `http://petstore.swagger.io/v2/swagger.json` | outputDir | The directory where the output should be stored. | File | `${project.build.directory}/asciidoc` | outputFile | The file path (without extension) where the output should be stored. | File | `${project.build.directory}/asciidoc/swagger` | config | The Swagger2Markup properties to configure the converter | Map | | |==== +=== Example + +You can copy the template project from GitHub to get started. + +https://github.com/Swagger2Markup/swagger2markup-maven-project-template + + +