Skip to content

Commit 232f581

Browse files
committed
Polish .adoc source files
1 parent 87e7a7b commit 232f581

8 files changed

+56
-138
lines changed

docs/src/docs/asciidoc/configuration.adoc

+8-12
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
This section covers how to configure Spring REST Docs.
55

6+
7+
68
[[configuration-uris]]
79
=== Documented URIs
810

911
This section covers configuring documented URIs.
1012

13+
14+
1115
[[configuration-uris-mockmvc]]
1216
==== MockMvc URI Customization
1317

@@ -30,12 +34,10 @@ This configuration is applied by `MockMvcRestDocumentationConfigurer`.
3034
You can use its API to change one or more of the defaults to suit your needs.
3135
The following example shows how to do so:
3236

33-
====
3437
[source,java,indent=0]
3538
----
3639
include::{examples-dir}/com/example/mockmvc/CustomUriConfiguration.java[tags=custom-uri-configuration]
3740
----
38-
====
3941

4042
NOTE: If the port is set to the default for the configured scheme (port 80 for HTTP or port 443 for HTTPS), it is omitted from any URIs in the generated snippets.
4143

@@ -59,13 +61,11 @@ When using WebTestClient, the default base for URIs documented by Spring REST Do
5961
You can customize this base by using the {spring-framework-api}/org/springframework/test/web/reactive/server/WebTestClient.Builder.html#baseUrl-java.lang.String-[ `baseUrl(String)` method on `WebTestClient.Builder`].
6062
The following example shows how to do so:
6163

62-
====
6364
[source,java,indent=0]
6465
----
6566
include::{examples-dir}/com/example/webtestclient/CustomUriConfiguration.java[tags=custom-uri-configuration]
6667
----
6768
<1> Configure the base of documented URIs to be `https://api.example.com`.
68-
====
6969

7070

7171

@@ -76,7 +76,6 @@ The default snippet encoding is `UTF-8`.
7676
You can change the default snippet encoding by using the `RestDocumentationConfigurer` API.
7777
For example, the following examples use `ISO-8859-1`:
7878

79-
====
8079
[source,java,indent=0,role="primary"]
8180
.MockMvc
8281
----
@@ -94,7 +93,6 @@ include::{examples-dir}/com/example/webtestclient/CustomEncoding.java[tags=custo
9493
----
9594
include::{examples-dir}/com/example/restassured/CustomEncoding.java[tags=custom-encoding]
9695
----
97-
====
9896

9997
TIP: When Spring REST Docs converts the content of a request or a response to a `String`, the `charset` specified in the `Content-Type` header is used if it is available.
10098
In its absence, the JVM's default `Charset` is used.
@@ -110,7 +108,6 @@ Markdown is also supported out of the box.
110108
You can change the default format by using the `RestDocumentationConfigurer` API.
111109
The following examples show how to do so:
112110

113-
====
114111
[source,java,indent=0,role="primary"]
115112
.MockMvc
116113
----
@@ -128,7 +125,6 @@ include::{examples-dir}/com/example/webtestclient/CustomFormat.java[tags=custom-
128125
----
129126
include::{examples-dir}/com/example/restassured/CustomFormat.java[tags=custom-format]
130127
----
131-
====
132128

133129

134130

@@ -147,7 +143,6 @@ Six snippets are produced by default:
147143
You can change the default snippet configuration during setup by using the `RestDocumentationConfigurer` API.
148144
The following examples produce only the `curl-request` snippet by default:
149145

150-
====
151146
[source,java,indent=0,role="primary"]
152147
.MockMvc
153148
----
@@ -165,15 +160,15 @@ include::{examples-dir}/com/example/webtestclient/CustomDefaultSnippets.java[tag
165160
----
166161
include::{examples-dir}/com/example/restassured/CustomDefaultSnippets.java[tags=custom-default-snippets]
167162
----
168-
====
163+
164+
169165

170166
[[configuration-default-preprocessors]]
171167
=== Default Operation Preprocessors
172168

173169
You can configure default request and response preprocessors during setup by using the `RestDocumentationConfigurer` API.
174170
The following examples remove the `Foo` headers from all requests and pretty print all responses:
175171

176-
====
177172
[source,java,indent=0,role="primary"]
178173
.MockMvc
179174
----
@@ -197,4 +192,5 @@ include::{examples-dir}/com/example/restassured/CustomDefaultOperationPreprocess
197192
----
198193
<1> Apply a request preprocessor that removes the header named `Foo`.
199194
<2> Apply a response preprocessor that pretty prints its content.
200-
====
195+
196+

docs/src/docs/asciidoc/contributing.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ If you would like an enhancement to be made to Spring REST Docs, pull requests a
2929
The source code is on {github}[GitHub].
3030
You may want to search the {github}/issues?q=is%3Aissue[existing issues] and {github}/pulls?q=is%3Apr[pull requests] to see if the enhancement has already been proposed.
3131
You may also want to {github}/issues/new[open a new issue] to discuss a possible enhancement before work on it begins.
32+
33+

docs/src/docs/asciidoc/customizing-requests-and-responses.adoc

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Preprocessing is configured by calling `document` with an `OperationRequestPrepr
88
You can obtain instances by using the static `preprocessRequest` and `preprocessResponse` methods on `Preprocessors`.
99
The following examples show how to do so:
1010

11-
====
1211
[source,java,indent=0,role="primary"]
1312
.MockMvc
1413
----
@@ -32,13 +31,11 @@ include::{examples-dir}/com/example/restassured/PerTestPreprocessing.java[tags=p
3231
----
3332
<1> Apply a request preprocessor that removes the header named `Foo`.
3433
<2> Apply a response preprocessor that pretty prints its content.
35-
====
3634

3735
Alternatively, you may want to apply the same preprocessors to every test.
3836
You can do so by using the `RestDocumentationConfigurer` API in your `@Before` method to configure the preprocessors.
3937
For example, to remove the `Foo` header from all requests and pretty print all responses, you could do one of the following (depending on your testing environment):
4038

41-
====
4239
[source,java,indent=0,role="primary"]
4340
.MockMvc
4441
----
@@ -62,12 +59,10 @@ include::{examples-dir}/com/example/restassured/EveryTestPreprocessing.java[tags
6259
----
6360
<1> Apply a request preprocessor that removes the header named `Foo`.
6461
<2> Apply a response preprocessor that pretty prints its content.
65-
====
6662

6763
Then, in each test, you can perform any configuration specific to that test.
6864
The following examples show how to do so:
6965

70-
====
7166
[source,java,indent=0,role="primary"]
7267
.MockMvc
7368
----
@@ -85,7 +80,6 @@ include::{examples-dir}/com/example/webtestclient/EveryTestPreprocessing.java[ta
8580
----
8681
include::{examples-dir}/com/example/restassured/EveryTestPreprocessing.java[tags=use]
8782
----
88-
====
8983

9084
Various built-in preprocessors, including those illustrated above, are available through the static methods on `Preprocessors`.
9185
See <<Preprocessors, below>> for further details.
@@ -155,3 +149,5 @@ If one of the built-in preprocessors does not meet your needs, you can write you
155149
You can then use your custom preprocessor in exactly the same way as any of the built-in preprocessors.
156150

157151
If you want to modify only the content (body) of a request or response, consider implementing the `ContentModifier` interface and using it with the built-in `ContentModifyingOperationPreprocessor`.
152+
153+

0 commit comments

Comments
 (0)