Skip to content

Commit e2e61df

Browse files
committed
Use snake_case consistently for anchors and cross-references
Closes gh-674
1 parent 1ee96bb commit e2e61df

File tree

6 files changed

+80
-80
lines changed

6 files changed

+80
-80
lines changed

samples/rest-notes-spring-data-rest/src/main/asciidoc/api-guide.adoc

+20-20
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Andy Wilkinson;
1212
[[overview]]
1313
= Overview
1414

15-
[[overview-http-verbs]]
15+
[[overview_http_verbs]]
1616
== HTTP verbs
1717

1818
RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its
@@ -34,7 +34,7 @@ use of HTTP verbs.
3434
| Used to delete an existing resource
3535
|===
3636

37-
[[overview-http-status-codes]]
37+
[[overview_http_status_codes]]
3838
== HTTP status codes
3939

4040
RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its
@@ -60,7 +60,7 @@ use of HTTP status codes.
6060
| The requested resource did not exist
6161
|===
6262

63-
[[overview-errors]]
63+
[[overview_errors]]
6464
== Errors
6565

6666
Whenever an error response (status code >= 400) is returned, the body will contain a JSON object
@@ -73,7 +73,7 @@ For example, a request that attempts to apply a non-existent tag to a note will
7373

7474
include::{snippets}/error-example/http-response.adoc[]
7575

76-
[[overview-hypermedia]]
76+
[[overview_hypermedia]]
7777
== Hypermedia
7878

7979
RESTful Notes uses hypermedia and resources include links to other resources in their
@@ -87,14 +87,14 @@ links to navigate from resource to resource.
8787

8888

8989

90-
[[resources-index]]
90+
[[resources_index]]
9191
== Index
9292

9393
The index provides the entry point into the service.
9494

9595

9696

97-
[[resources-index-access]]
97+
[[resources_index_access]]
9898
=== Accessing the index
9999

100100
A `GET` request is used to access the index
@@ -103,14 +103,14 @@ operation::index-example[snippets='response-fields,http-response,links']
103103

104104

105105

106-
[[resources-notes]]
106+
[[resources_notes]]
107107
== Notes
108108

109109
The Notes resources is used to create and list notes
110110

111111

112112

113-
[[resources-notes-list]]
113+
[[resources_notes_list]]
114114
=== Listing notes
115115

116116
A `GET` request will list all of the service's notes.
@@ -119,7 +119,7 @@ operation::notes-list-example[snippets='response-fields,curl-request,http-respon
119119

120120

121121

122-
[[resources-notes-create]]
122+
[[resources_notes_create]]
123123
=== Creating a note
124124

125125
A `POST` request is used to create a note.
@@ -128,14 +128,14 @@ operation::notes-create-example[snippets='request-fields,curl-request,http-respo
128128

129129

130130

131-
[[resources-tags]]
131+
[[resources_tags]]
132132
== Tags
133133

134134
The Tags resource is used to create and list tags.
135135

136136

137137

138-
[[resources-tags-list]]
138+
[[resources_tags_list]]
139139
=== Listing tags
140140

141141
A `GET` request will list all of the service's tags.
@@ -144,7 +144,7 @@ operation::tags-list-example[snippets='response-fields,curl-request,http-respons
144144

145145

146146

147-
[[resources-tags-create]]
147+
[[resources_tags_create]]
148148
=== Creating a tag
149149

150150
A `POST` request is used to create a note
@@ -153,21 +153,21 @@ operation::tags-create-example[snippets='request-fields,curl-request,http-respon
153153

154154

155155

156-
[[resources-note]]
156+
[[resources_note]]
157157
== Note
158158

159159
The Note resource is used to retrieve, update, and delete individual notes
160160

161161

162162

163-
[[resources-note-links]]
163+
[[resources_note_links]]
164164
=== Links
165165

166166
include::{snippets}/note-get-example/links.adoc[]
167167

168168

169169

170-
[[resources-note-retrieve]]
170+
[[resources_note_retrieve]]
171171
=== Retrieve a note
172172

173173
A `GET` request will retrieve the details of a note
@@ -176,7 +176,7 @@ operation::note-get-example[snippets='response-fields,curl-request,http-response
176176

177177

178178

179-
[[resources-note-update]]
179+
[[resources_note_update]]
180180
=== Update a note
181181

182182
A `PATCH` request is used to update a note
@@ -197,21 +197,21 @@ include::{snippets}/note-update-example/http-response.adoc[]
197197

198198

199199

200-
[[resources-tag]]
200+
[[resources_tag]]
201201
== Tag
202202

203203
The Tag resource is used to retrieve, update, and delete individual tags
204204

205205

206206

207-
[[resources-tag-links]]
207+
[[resources_tag_links]]
208208
=== Links
209209

210210
include::{snippets}/tag-get-example/links.adoc[]
211211

212212

213213

214-
[[resources-tag-retrieve]]
214+
[[resources_tag_retrieve]]
215215
=== Retrieve a tag
216216

217217
A `GET` request will retrieve the details of a tag
@@ -220,7 +220,7 @@ operation::tag-get-example[snippets='response-fields,curl-request,http-response'
220220

221221

222222

223-
[[resources-tag-update]]
223+
[[resources_tag_update]]
224224
=== Update a tag
225225

226226
A `PATCH` request is used to update a tag

samples/rest-notes-spring-data-rest/src/main/asciidoc/getting-started-guide.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ to describe the relationships between resources and to allow navigation between
1515

1616

1717

18-
[[getting-started-running-the-service]]
18+
[[getting_started_running_the_service]]
1919
== Running the service
2020
RESTful Notes is written using https://projects.spring.io/spring-boot[Spring Boot] which
2121
makes it easy to get it up and running so that you can start exploring the REST API.
@@ -51,7 +51,7 @@ Note the `_links` in the JSON response. They are key to navigating the API.
5151

5252

5353

54-
[[getting-started-creating-a-note]]
54+
[[getting_started_creating_a_note]]
5555
== Creating a note
5656
Now that you've started the service and verified that it works, the next step is to use
5757
it to create a new note. As you saw above, the URI for working with notes is included as
@@ -82,7 +82,7 @@ Note the `tags` link which we'll make use of later.
8282

8383

8484

85-
[[getting-started-creating-a-tag]]
85+
[[getting_started_creating_a_tag]]
8686
== Creating a tag
8787
To make a note easier to find, it can be associated with any number of tags. To be able
8888
to tag a note, you must first create the tag.
@@ -113,15 +113,15 @@ include::{snippets}/creating-a-note/4/http-response.adoc[]
113113

114114

115115

116-
[[getting-started-tagging-a-note]]
116+
[[getting_started_tagging_a_note]]
117117
== Tagging a note
118118
A tag isn't particularly useful until it's been associated with one or more notes. There
119119
are two ways to tag a note: when the note is first created or by updating an existing
120120
note. We'll look at both of these in turn.
121121

122122

123123

124-
[[getting-started-tagging-a-note-creating]]
124+
[[getting_started_tagging_a_note_creating]]
125125
=== Creating a tagged note
126126
The process is largely the same as we saw before, but this time, in addition to providing
127127
a title and body for the note, we'll also provide the tag that we want to be associated
@@ -152,7 +152,7 @@ include::{snippets}/creating-a-note/7/http-response.adoc[]
152152

153153

154154

155-
[[getting-started-tagging-a-note-existing]]
155+
[[getting_started_tagging_a_note_existing]]
156156
=== Tagging an existing note
157157
An existing note can be tagged by executing a `PATCH` request against the note's URI with
158158
a body that contains the array of tags to be associated with the note. We'll used the

samples/rest-notes-spring-data-rest/src/test/java/com/example/notes/ApiDocumentation.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2019 the original author or authors.
2+
* Copyright 2014-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -111,11 +111,11 @@ public void indexExample() throws Exception {
111111
.andExpect(status().isOk())
112112
.andDo(document("index-example",
113113
links(
114-
linkWithRel("notes").description("The <<resources-notes,Notes resource>>"),
115-
linkWithRel("tags").description("The <<resources-tags,Tags resource>>"),
114+
linkWithRel("notes").description("The <<resources_notes,Notes resource>>"),
115+
linkWithRel("tags").description("The <<resources_tags,Tags resource>>"),
116116
linkWithRel("profile").description("The ALPS profile for the service")),
117117
responseFields(
118-
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"))));
118+
subsectionWithPath("_links").description("<<resources_index_access_links,Links>> to other resources"))));
119119

120120
}
121121

@@ -136,8 +136,8 @@ public void notesListExample() throws Exception {
136136
linkWithRel("self").description("Canonical link for this resource"),
137137
linkWithRel("profile").description("The ALPS profile for this resource")),
138138
responseFields(
139-
subsectionWithPath("_embedded.notes").description("An array of <<resources-note, Note resources>>"),
140-
subsectionWithPath("_links").description("<<resources-tags-list-links, Links>> to other resources"))));
139+
subsectionWithPath("_embedded.notes").description("An array of <<resources_note, Note resources>>"),
140+
subsectionWithPath("_links").description("<<resources_tags_list_links, Links>> to other resources"))));
141141
}
142142

143143
@Test
@@ -201,13 +201,13 @@ public void noteGetExample() throws Exception {
201201
.andDo(print())
202202
.andDo(document("note-get-example",
203203
links(
204-
linkWithRel("self").description("Canonical link for this <<resources-note,note>>"),
205-
linkWithRel("note").description("This <<resources-note,note>>"),
204+
linkWithRel("self").description("Canonical link for this <<resources_note,note>>"),
205+
linkWithRel("note").description("This <<resources_note,note>>"),
206206
linkWithRel("tags").description("This note's tags")),
207207
responseFields(
208208
fieldWithPath("title").description("The title of the note"),
209209
fieldWithPath("body").description("The body of the note"),
210-
subsectionWithPath("_links").description("<<resources-note-links,Links>> to other resources"))));
210+
subsectionWithPath("_links").description("<<resources_note_links,Links>> to other resources"))));
211211
}
212212

213213
@Test
@@ -226,8 +226,8 @@ public void tagsListExample() throws Exception {
226226
linkWithRel("self").description("Canonical link for this resource"),
227227
linkWithRel("profile").description("The ALPS profile for this resource")),
228228
responseFields(
229-
subsectionWithPath("_embedded.tags").description("An array of <<resources-tag,Tag resources>>"),
230-
subsectionWithPath("_links").description("<<resources-tags-list-links, Links>> to other resources"))));
229+
subsectionWithPath("_embedded.tags").description("An array of <<resources_tag,Tag resources>>"),
230+
subsectionWithPath("_links").description("<<resources_tags_list_links, Links>> to other resources"))));
231231
}
232232

233233
@Test
@@ -304,12 +304,12 @@ public void tagGetExample() throws Exception {
304304
.andExpect(jsonPath("name", is(tag.get("name"))))
305305
.andDo(document("tag-get-example",
306306
links(
307-
linkWithRel("self").description("Canonical link for this <<resources-tag,tag>>"),
308-
linkWithRel("tag").description("This <<resources-tag,tag>>"),
309-
linkWithRel("notes").description("The <<resources-tagged-notes,notes>> that have this tag")),
307+
linkWithRel("self").description("Canonical link for this <<resources_tag,tag>>"),
308+
linkWithRel("tag").description("This <<resources_tag,tag>>"),
309+
linkWithRel("notes").description("The notes that have this tag")),
310310
responseFields(
311311
fieldWithPath("name").description("The name of the tag"),
312-
subsectionWithPath("_links").description("<<resources-tag-links,Links>> to other resources"))));
312+
subsectionWithPath("_links").description("<<resources_tag_links,Links>> to other resources"))));
313313
}
314314

315315
@Test

0 commit comments

Comments
 (0)