You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
41
43
@@ -59,13 +61,11 @@ When using WebTestClient, the default base for URIs documented by Spring REST Do
59
61
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`].
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.
100
98
In its absence, the JVM's default `Charset` is used.
@@ -110,7 +108,6 @@ Markdown is also supported out of the box.
110
108
You can change the default format by using the `RestDocumentationConfigurer` API.
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/contributing.adoc
+2
Original file line number
Diff line number
Diff line change
@@ -29,3 +29,5 @@ If you would like an enhancement to be made to Spring REST Docs, pull requests a
29
29
The source code is on {github}[GitHub].
30
30
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.
31
31
You may also want to {github}/issues/new[open a new issue] to discuss a possible enhancement before work on it begins.
<1> Apply a request preprocessor that removes the header named `Foo`.
34
33
<2> Apply a response preprocessor that pretty prints its content.
35
-
====
36
34
37
35
Alternatively, you may want to apply the same preprocessors to every test.
38
36
You can do so by using the `RestDocumentationConfigurer` API in your `@Before` method to configure the preprocessors.
39
37
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):
Various built-in preprocessors, including those illustrated above, are available through the static methods on `Preprocessors`.
91
85
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
155
149
You can then use your custom preprocessor in exactly the same way as any of the built-in preprocessors.
156
150
157
151
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`.
0 commit comments