$ curl 'http://localhost:8080/items/1' -i -X DELETE \
- -H 'Authorization: Bearer f5f4f322-0af7-4c4b-b323-02f6fcf60514'
+ -H 'Authorization: Bearer 412a28e4-f983-4b65-ace7-c287b1f34e33'
From e4259d88e0a63994c7e37a029b817c5c48bb5c74 Mon Sep 17 00:00:00 2001 From: rubenpirotteQNH <30623846+rubenpirotteQNH@users.noreply.github.com> Date: Thu, 20 Sep 2018 09:11:42 +0200 Subject: [PATCH 1/3] regenerated docs --- docs/index.html | 96 +++++++++--- samples/java-webmvc/generated-docs/index.html | 20 +-- .../generated-docs/index.html | 37 ++--- .../kotlin-webmvc/generated-docs/index.html | 38 ++--- .../asciidoctor/auto-authorization.snippet | 7 +- .../JacksonResponseFieldSnippetTest.java | 9 +- .../request/RequestParametersSnippetTest.java | 9 +- .../restdocs/section/SectionSnippetTest.java | 145 +++++++++--------- spring-auto-restdocs-docs/constraints.adoc | 14 +- .../getting-started.adoc | 8 +- spring-auto-restdocs-docs/index.adoc | 5 +- 11 files changed, 220 insertions(+), 168 deletions(-) diff --git a/docs/index.html b/docs/index.html index 615a5149..de74bd46 100644 --- a/docs/index.html +++ b/docs/index.html @@ -443,7 +443,7 @@
Is Kotlin supported?
+Yes, Spring Auto REST Docs 1.0.13 and 2.0.0 introduced Kotlin support.
+Instead of the Javadoc Doclet one has to use the Dokka extension
+spring-auto-restdocs-dokka-json. The extension is only available as 2.0.x,
+but works with both version of Spring Auto REST Docs.
Is Java 9 supported?
+Yes, see Getting Started.
+Java 7
+Java 8 or Kotlin 1.2
Spring REST Docs 2.0.2.RELEASE (see documentation)
+Spring REST Docs 2.0.2.RELEASE (see documentation)
Jackson has to be used for creating and parsing JSON
For Java 7 and Spring REST Docs 1.2.x support, +please use the 1.0.x version of Spring Auto REST Docs.
+For Java 9 support, use spring-auto-restdocs-json-doclet-jdk9 as doclet dependency.
Setup project for Spring REST Docs
+Setup project for Spring REST Docs
Additional configuration for this extension:
@@ -642,7 +660,7 @@,.
The directories are processed in order and only the first found JSON file is used.
+spring-auto-restdocs-json-doclet-jdk9 as doclet dependency.,.
The directories are processed in order and only the first found JSON file is used.
+spring-auto-restdocs-json-doclet-jdk9 as doclet dependency.This project -includes a sample application that demonstrates most features.
+This projects includes a +Java Web MVC example, +a +Java WebTestClient example +and a +Kotlin Web MVC example +application that demonstrate most features.
The generated documentation of the example project can be viewed -here.
+The generated documentation can be viewed for the +Java Web MVC example, +the +Java WebTestClient example +and the +Kotlin Web MCV example.
Provide your own template in org/springframework/restdocs/templates/asciidoctor (or markdown) package of your resources.
- You can override REST Docs
- templates
+You can override REST Docs templates
and Auto REST Docs templates.
Important is to omit default- part from the template name so that the resolution algorithm will prefer this custom template.
- See also original documentation for additional details.
The following three constraints are used to determine whether a field is optional. Their descriptions are not included in the field descriptions.
@@ -1587,13 +1621,29 @@NotNull (Bean Validation)
+NotNull
+NotEmpty
+NotBlank
+Along with JSR-303 annotations, optionality is also determined based on:
+required parameter of @RequestParam
NotEmpty (Hibernate Validator)
+field type being java.util.Optional
NotBlank (Hibernate Validator)
+Koltin field being non-nullable
.description.
The value is the description and can contain placeholders for annotation methods,
e.g. ${value} to get the content of value().
- For more details, see original documentation of here.
+For more details, see original documentation of here.
Example for the constraint annotation myproject.constraints.OneOf:
We use version 2.0.2.RELEASE of Spring REST Docs in this example.
+We use version 2.0.2.RELEASE of Spring REST Docs in this example.
You find the currently required version in pom.xml:
Afterwards the test JAR is located at
- spring-restdocs/spring-restdocs-core/build/libs/spring-restdocs-core-2.0.2.RELEASE-test.jar
+spring-restdocs/spring-restdocs-core/build/libs/spring-restdocs-core-2.0.2.RELEASE-test.jar
and has to be installed with the Maven command shown in the section above.
$ curl 'http://localhost:8080/items' -i -X POST \
-H 'Content-Type: application/json' \
- -H 'Authorization: Bearer f5f4f322-0af7-4c4b-b323-02f6fcf60514' \
+ -H 'Authorization: Bearer 412a28e4-f983-4b65-ace7-c287b1f34e33' \
-d '{"description":"Hot News"}'
@@ -1382,7 +1382,7 @@ $ curl 'http://localhost:8080/items/1' -i -X PUT \
-H 'Content-Type: application/json' \
- -H 'Authorization: Bearer f5f4f322-0af7-4c4b-b323-02f6fcf60514' \
+ -H 'Authorization: Bearer 412a28e4-f983-4b65-ace7-c287b1f34e33' \
-d '{"description":"Hot News"}'
@@ -1488,7 +1488,7 @@ $ curl 'http://localhost:8080/items/1' -i -X DELETE \
- -H 'Authorization: Bearer f5f4f322-0af7-4c4b-b323-02f6fcf60514'
+ -H 'Authorization: Bearer 412a28e4-f983-4b65-ace7-c287b1f34e33'
$ curl 'http://localhost:8080/items/1/process?command=increase' -i -X POST \
+$ curl 'http://localhost:8080/items/1/process' -i -X POST \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'command=increase'