Skip to content

Commit ed74548

Browse files
committed
Adopt the Section IDs extension
See gh-1009
1 parent 385edf3 commit ed74548

File tree

8 files changed

+101
-87
lines changed

8 files changed

+101
-87
lines changed

docs/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ configurations {
99
}
1010

1111
dependencies {
12+
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids:0.6.3")
1213
asciidoctorExt("io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.5")
1314

1415
testCompileOnly("org.hamcrest:hamcrest-core")

docs/src/docs/asciidoc/configuration.adoc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ This section covers how to configure Spring REST Docs.
55

66

77

8-
[[configuration-uris]]
8+
[[configuration.uris]]
99
=== Documented URIs
1010

1111
This section covers configuring documented URIs.
1212

1313

1414

15-
[[configuration-uris-mockmvc]]
15+
[[configuration.uris.mockmvc]]
1616
==== MockMvc URI Customization
1717

1818
When using MockMvc, the default configuration for URIs documented by Spring REST Docs is as follows:
@@ -45,7 +45,18 @@ TIP: To configure a request's context path, use the `contextPath` method on `Moc
4545

4646

4747

48-
[[configuration-uris-webtestclient]]
48+
[[configuration.uris.rest-assured]]
49+
==== REST Assured URI Customization
50+
51+
REST Assured tests a service by making actual HTTP requests. As a result, URIs must be
52+
customized once the operation on the service has been performed but before it is
53+
documented. A
54+
<<customizing-requests-and-responses.preprocessors.modify-uris, REST-Assured-specific
55+
preprocessor>> is provided for this purpose.
56+
57+
58+
59+
[[configuration.uris.webtestclient]]
4960
==== WebTestClient URI Customization
5061

5162
When using WebTestClient, the default base for URIs documented by Spring REST Docs is `http://localhost:8080`.
@@ -60,7 +71,7 @@ include::{examples-dir}/com/example/webtestclient/CustomUriConfiguration.java[ta
6071

6172

6273

63-
[[configuration-snippet-encoding]]
74+
[[configuration.snippet-encoding]]
6475
=== Snippet Encoding
6576

6677
The default snippet encoding is `UTF-8`.
@@ -85,7 +96,7 @@ You can configure the JVM's default `Charset` by using the `file.encoding` syste
8596

8697

8798

88-
[[configuration-snippet-template-format]]
99+
[[configuration.snippet-template-format]]
89100
=== Snippet Template Format
90101

91102
The default snippet template format is Asciidoctor.
@@ -107,7 +118,7 @@ include::{examples-dir}/com/example/webtestclient/CustomFormat.java[tags=custom-
107118

108119

109120

110-
[[configuration-default-snippets]]
121+
[[configuration.default-snippets]]
111122
=== Default Snippets
112123

113124
Six snippets are produced by default:
@@ -136,7 +147,7 @@ include::{examples-dir}/com/example/webtestclient/CustomDefaultSnippets.java[tag
136147

137148

138149

139-
[[configuration-default-preprocessors]]
150+
[[configuration.default-preprocessors]]
140151
=== Default Operation Preprocessors
141152

142153
You can configure default request and response preprocessors during setup by using the `RestDocumentationConfigurer` API.

docs/src/docs/asciidoc/contributing.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ However, we cannot achieve that goal without your contributions.
66

77

88

9-
[[contributing-questions]]
9+
[[contributing.questions]]
1010
=== Questions
1111

1212
You can ask questions about Spring REST Docs on https://stackoverflow.com[Stack Overflow] by using the `spring-restdocs` tag.
1313
Similarly, we encourage you to help your fellow Spring REST Docs users by answering questions.
1414

1515

1616

17-
[[contributing-bugs]]
17+
[[contributing.bugs]]
1818
=== Bugs
1919

2020
If you believe you have found a bug, please take a moment to search the {github}/issues?q=is%3Aissue[existing issues].
2121
If no one else has reported the problem, please {github}/issues/new[open a new issue] that describes the problem in detail and, ideally, includes a test that reproduces it.
2222

2323

2424

25-
[[contributing-enhancements]]
25+
[[contributing.enhancements]]
2626
=== Enhancements
2727

2828
If you would like an enhancement to be made to Spring REST Docs, pull requests are most welcome.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ See <<Preprocessors, below>> for further details.
6464

6565

6666

67-
[[customizing-requests-and-responses-preprocessors]]
67+
[[customizing-requests-and-responses.preprocessors]]
6868
=== Preprocessors
6969

7070

7171

72-
[[customizing-requests-and-responses-preprocessors-pretty-print]]
72+
[[customizing-requests-and-responses.preprocessors.pretty-print]]
7373
==== Pretty Printing
7474

7575
`prettyPrint` on `Preprocessors` formats the content of the request or response to make it easier to read.
7676

7777

7878

79-
[[customizing-requests-and-responses-preprocessors-mask-links]]
79+
[[customizing-requests-and-responses.preprocessors.mask-links]]
8080
==== Masking Links
8181

8282
If you are documenting a hypermedia-based API, you may want to encourage clients to navigate the API by using links rather than through the use of hard coded URIs.
@@ -86,32 +86,32 @@ You can also specify a different replacement if you wish.
8686

8787

8888

89-
[[customizing-requests-and-responses-preprocessors-modify-headers]]
89+
[[customizing-requests-and-responses.preprocessors.modify-headers]]
9090
==== Modifying Headers
9191

9292
You can use `modifyHeaders` on `Preprocessors` to add, set, and remove request or response headers.
9393

9494

9595

96-
[[customizing-requests-and-responses-preprocessors-replace-patterns]]
96+
[[customizing-requests-and-responses.preprocessors.replace-patterns]]
9797
==== Replacing Patterns
9898

9999
`replacePattern` on `Preprocessors` provides a general purpose mechanism for replacing content in a request or response.
100100
Any occurrences that match a regular expression are replaced.
101101

102102

103103

104-
[[customizing-requests-and-responses-preprocessors-modify-uris]]
104+
[[customizing-requests-and-responses.preprocessors.modify-uris]]
105105
==== Modifying URIs
106106

107-
TIP: If you use MockMvc or a WebTestClient that is not bound to a server, you should customize URIs by <<configuration-uris, changing the configuration>>.
107+
TIP: If you use MockMvc or a WebTestClient that is not bound to a server, you should customize URIs by <<configuration.uris, changing the configuration>>.
108108

109109
You can use `modifyUris` on `Preprocessors` to modify any URIs in a request or a response.
110110
When using `WebTestClient` bound to a server, this lets you customize the URIs that appear in the documentation while testing a local instance of the service.
111111

112112

113113

114-
[[customizing-requests-and-responses-preprocessors-writing-your-own]]
114+
[[customizing-requests-and-responses.preprocessors.writing-your-own]]
115115
==== Writing Your Own Preprocessor
116116

117117
If one of the built-in preprocessors does not meet your needs, you can write your own by implementing the `OperationPreprocessor` interface.

0 commit comments

Comments
 (0)