Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit f3071df

Browse files
authored
Update documentation (#242)
* Update documentation on Kotlin and Java 9 * Fix requirements * Adjust section about example projects * List all examples
1 parent 5b4d1f6 commit f3071df

File tree

3 files changed

+58
-8
lines changed

3 files changed

+58
-8
lines changed

spring-auto-restdocs-docs/getting-started.adoc

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66

77
Spring Auto REST Docs has the following minimum requirements:
88

9-
* Java 7
9+
* Java 8 or Kotlin 1.2
1010
* Spring REST Docs ${spring-restdocs.version} (see http://docs.spring.io/spring-restdocs/docs/${spring-restdocs.version}/reference/html5/[documentation])
1111
* Jackson has to be used for creating and parsing JSON
1212

13+
For Java 7 and Spring REST Docs 1.2.x support,
14+
please use the 1.0.x version of Spring Auto REST Docs.
15+
1316
[[gettingstarted-usage]]
1417
=== Usage
1518

@@ -241,10 +244,19 @@ repositories {
241244
----
242245

243246
[[gettingstarted-sample]]
244-
=== Sample application
247+
=== Sample applications
245248

246-
https://github.com/ScaCap/spring-auto-restdocs/tree/master/spring-auto-restdocs-example[This project]
247-
includes a sample application that demonstrates most features.
249+
This projects includes a
250+
https://github.com/ScaCap/spring-auto-restdocs/tree/master/samples/java-webmvc[Java Web MVC example],
251+
a
252+
https://github.com/ScaCap/spring-auto-restdocs/tree/master/samples/java-webtestclient[Java WebTestClient example]
253+
and a
254+
https://github.com/ScaCap/spring-auto-restdocs/tree/master/samples/kotlin-webmvc[Kotlin Web MVC example]
255+
application that demonstrate most features.
248256

249-
The generated documentation of the example project can be viewed
250-
https://htmlpreview.github.io/?https://github.com/ScaCap/spring-auto-restdocs/blob/master/spring-auto-restdocs-example/generated-docs/index.html[here].
257+
The generated documentation can be viewed for the
258+
https://htmlpreview.github.io/?https://github.com/ScaCap/spring-auto-restdocs/blob/master/samples/java-webmvc/generated-docs/index.html[Java Web MVC example],
259+
the
260+
https://htmlpreview.github.io/?https://github.com/ScaCap/spring-auto-restdocs/blob/master/samples/java-webtestclient/generated-docs/index.html[Java WebTestClient example]
261+
and the
262+
https://htmlpreview.github.io/?https://github.com/ScaCap/spring-auto-restdocs/blob/master/samples/kotlin-webmvc/generated-docs/index.html[Kotlin Web MCV example].

spring-auto-restdocs-docs/index.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ Can Spring REST Docs and Spring Auto REST Docs features be combined?::
5858
Yes, this even works in the same test.
5959
One can generate Spring REST Docs snippets and Spring Auto REST Docs snippets out of the same test.
6060
This is demonstrated in the example project.
61+
Is Kotlin supported?::
62+
Yes, Spring Auto REST Docs 1.0.13 and 2.0.0 introduced Kotlin support.
63+
Instead of the Javadoc Doclet one has to use the Dokka extension
64+
`spring-auto-restdocs-dokka-json`. The extension is only available as 2.0.x,
65+
but works with both version of Spring Auto REST Docs.
66+
Is Java 9+ supported?::
67+
Not yet, because Java 9 introduced a new Doclet API and
68+
we have not created a Java 9+ Doclet yet.
6169

6270
include::getting-started.adoc[]
6371

spring-auto-restdocs-dokka-json/README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ The same holds true for this Dokka extension.
88

99
## Usage with Maven
1010

11-
This Dokka extension can be used with the standard `dokka-maven-plugin`.
11+
This Dokka extension can be used with the `dokka-maven-plugin`.
1212
To avoid any incompatibilities, the Dokka version of the `dokka-maven-plugin` and of this extension should be the same.
1313
If this extension is included as a dependency of the plugin, the output format `auto-restdocs-json` can be used.
1414

1515
Example usage:
16-
```
16+
```xml
1717
<plugin>
1818
<groupId>org.jetbrains.dokka</groupId>
1919
<artifactId>dokka-maven-plugin</artifactId>
@@ -39,4 +39,34 @@ Example usage:
3939
</configuration>
4040
</plugin>
4141
```
42+
[Full example](https://github.com/ScaCap/spring-auto-restdocs/blob/master/samples/kotlin-webmvc/pom.xml)
43+
44+
## Usage with Gradle
45+
46+
Starting with version 2.0.2, this Dokka extension can be used with the `dokka-gradle-plugin`.
47+
To avoid any incompatibilities, the Dokka version of the `dokka-gradle-plugin` and of this extension should be the same.
48+
If this extension is set as the `dokkaFatJar` in the dokka task, the output format `auto-restdocs-json` can be used.
49+
50+
```groovy
51+
buildscript {
52+
ext {
53+
springAutoRestDocsVersion = "2.0.2"
54+
dokkaVersion = "0.9.16"
55+
}
56+
repositories {
57+
jcenter()
58+
mavenCentral()
59+
}
60+
dependencies {
61+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
62+
}
63+
}
64+
apply plugin: "org.jetbrains.dokka"
65+
66+
dokka {
67+
outputFormat = "auto-restdocs-json"
68+
dokkaFatJar = "capital.scalable:spring-auto-restdocs-dokka-json:$springAutoRestDocsVersion"
69+
}
70+
```
71+
[Full example](https://github.com/ScaCap/spring-auto-restdocs/blob/master/samples/kotlin-webmvc/build.gradle)
4272

0 commit comments

Comments
 (0)