Skip to content

Commit 87e7a7b

Browse files
committed
Format documentation using one sentence per line
Closes gh-772
1 parent d4d83f2 commit 87e7a7b

11 files changed

+545
-777
lines changed

CONTRIBUTING.md

+17-27
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,38 @@
11
# Contributing to Spring REST Docs
22

3-
Spring REST Docs is released under the Apache 2.0 license. If you would like to
4-
contribute something, or simply want to work with the code, this document should help you
5-
to get started.
3+
Spring REST Docs is released under the Apache 2.0 license.
4+
If you would like to contribute something, or simply want to work with the code, this document should help you to get started.
65

76
## Code of conduct
87

9-
This project adheres to the Contributor Covenant [code of conduct][1]. By participating,
10-
you are expected to uphold this code. Please report unacceptable behavior to
11-
8+
This project adheres to the Contributor Covenant [code of conduct][1]. By participating, you are expected to uphold this code.
9+
Please report unacceptable behavior to [email protected].
1210

1311
## Sign the contributor license agreement
1412

15-
Before we accept a non-trivial patch or pull request we will need you to sign the
16-
[contributor's license agreement (CLA)][2]. Signing the contributor's agreement does not
17-
grant anyone commit rights to the main repository, but it does mean that we can accept
18-
your contributions, and you will get an author credit if we do.
13+
Before we accept a non-trivial patch or pull request we will need you to sign the [contributor's license agreement (CLA)][2].
14+
Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do.
1915

2016

2117
## Code conventions and housekeeping
2218

2319
None of these is essential for a pull request, but they will all help
2420

25-
- Make sure all new `.java` files to have a simple Javadoc class comment with at least an
26-
`@author` tag identifying you, and preferably at least a paragraph on what the class is
27-
for.
28-
- Add the ASF license header comment to all new `.java` files (copy from existing files
29-
in the project)
30-
- Add yourself as an `@author` to the .java files that you modify substantially (more
31-
than cosmetic changes).
21+
- Make sure all new `.java` files to have a simple Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for
22+
- Add the ASF license header comment to all new `.java` files (copy from existing files in the project)
23+
- Add yourself as an `@author` to the .java files that you modify substantially (more than cosmetic changes)
3224
- Add some Javadocs
3325
- Add unit tests that covers and new or modified functionality
34-
- Whenever possible, please rebase your branch against the current main (or other
35-
target branch in the project).
36-
* When writing a commit message please follow [these conventions][3]. Also, if you are
37-
fixing an existing issue please add `Fixes gh-nnn` at the end of the commit message
38-
(where nnn is the issue number).
26+
- Whenever possible, please rebase your branch against the current main (or other target branch in the project)
27+
- When writing a commit message please follow [these conventions][3]
28+
Also, if you are fixing an existing issue please add `Fixes gh-nnn` at the end of the commit message (where nnn is the issue number)
3929

4030
## Working with the code
4131

4232
### Building from source
4333

44-
To build the source you will need Java 8 or later. The code is built with Gradle:
34+
To build the source you will need Java 8 or later.
35+
The code is built with Gradle:
4536

4637
```
4738
$ ./gradlew build
@@ -55,15 +46,14 @@ $ ./gradlew buildSamples
5546

5647
### Importing into Eclipse
5748

58-
The project has Gradle's Eclipse plugin applied. Eclipse project and classpath metadata
59-
can be generated by running the `eclipse` task:
49+
The project has Gradle's Eclipse plugin applied.
50+
Eclipse project and classpath metadata can be generated by running the `eclipse` task:
6051

6152
```
6253
$ ./gradlew eclipse
6354
```
6455

65-
The project can then be imported into Eclipse using `File -> Import…` and then selecting
66-
`General -> Existing Projects into Workspace`.
56+
The project can then be imported into Eclipse using `File -> Import…` and then selecting `General -> Existing Projects into Workspace`.
6757

6858
[1]: CODE_OF_CONDUCT.md
6959
[2]: https://cla.pivotal.io/sign/spring

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
## Overview
44

5-
The primary goal of this project is to make it easy to document RESTful services by
6-
combining content that's been hand-written using [Asciidoctor][3] with auto-generated
7-
examples produced with the [Spring MVC Test][4] framework. The result is intended to be
8-
an easy-to-read user guide, akin to [GitHub's API documentation][5] for example, rather
9-
than the fully automated, dense API documentation produced by tools like [Swagger][6].
5+
The primary goal of this project is to make it easy to document RESTful services by combining content that's been hand-written using [Asciidoctor][3] with auto-generated examples produced with the [Spring MVC Test][4] framework.
6+
The result is intended to be an easy-to-read user guide, akin to [GitHub's API documentation][5] for example, rather than the fully automated, dense API documentation produced by tools like [Swagger][6].
107

11-
For a broader introduction see the Documenting RESTful APIs presentation. Both the
12-
[slides][7] and a [video recording][8] are available.
8+
For a broader introduction see the Documenting RESTful APIs presentation.
9+
Both the [slides][7] and a [video recording][8] are available.
1310

1411
## Learning more
1512

1613
To learn more about Spring REST Docs, please consult the [reference documentation][9].
1714

1815
## Building from source
1916

20-
You will need Java 8 or later to build Spring REST Docs. It is built using [Gradle][10]:
17+
You will need Java 8 or later to build Spring REST Docs.
18+
It is built using [Gradle][10]:
2119

2220
```
2321
./gradlew build
@@ -29,9 +27,9 @@ Contributors to this project agree to uphold its [code of conduct][11].
2927

3028
There are several that you can contribute to Spring REST Docs:
3129

32-
- Open a [pull request][12]. Please see the [contributor guidelines][13] for details.
33-
- Ask and answer questions on Stack Overflow using the [`spring-restdocs`][15] tag.
34-
- Chat with fellow users [on Gitter][16].
30+
- Open a [pull request][12]. Please see the [contributor guidelines][13] for details
31+
- Ask and answer questions on Stack Overflow using the [`spring-restdocs`][15] tag
32+
- Chat with fellow users [on Gitter][16]
3533

3634
## Third-party extensions
3735

docs/src/docs/asciidoc/configuration.adoc

+25-34
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ This section covers configuring documented URIs.
1111
[[configuration-uris-mockmvc]]
1212
==== MockMvc URI Customization
1313

14-
When using MockMvc, the default configuration for URIs documented by Spring REST Docs is
15-
as follows:
14+
When using MockMvc, the default configuration for URIs documented by Spring REST Docs is as follows:
1615

1716
|===
1817
|Setting |Default
@@ -27,9 +26,9 @@ as follows:
2726
|`8080`
2827
|===
2928

30-
This configuration is applied by `MockMvcRestDocumentationConfigurer`. You can use its
31-
API to change one or more of the defaults to suit your needs. The following example shows
32-
how to do so:
29+
This configuration is applied by `MockMvcRestDocumentationConfigurer`.
30+
You can use its API to change one or more of the defaults to suit your needs.
31+
The following example shows how to do so:
3332

3433
====
3534
[source,java,indent=0]
@@ -38,33 +37,27 @@ include::{examples-dir}/com/example/mockmvc/CustomUriConfiguration.java[tags=cus
3837
----
3938
====
4039

41-
NOTE: If the port is set to the default for the configured scheme (port 80 for HTTP or
42-
port 443 for HTTPS), it is omitted from any URIs in the generated snippets.
40+
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.
4341

44-
TIP: To configure a request's context path, use the `contextPath` method on
45-
`MockHttpServletRequestBuilder`.
42+
TIP: To configure a request's context path, use the `contextPath` method on `MockHttpServletRequestBuilder`.
4643

4744

4845

4946
[[configuration-uris-rest-assured]]
5047
==== REST Assured URI Customization
5148

52-
REST Assured tests a service by making actual HTTP requests. As a result, URIs must be
53-
customized once the operation on the service has been performed but before it is
54-
documented. A
55-
<<customizing-requests-and-responses-preprocessors-modify-uris, REST-Assured-specific
56-
preprocessor>> is provided for this purpose.
49+
REST Assured tests a service by making actual HTTP requests.
50+
As a result, URIs must be customized once the operation on the service has been performed but before it is documented.
51+
A <<customizing-requests-and-responses-preprocessors-modify-uris, REST-Assured-specific preprocessor>> is provided for this purpose.
5752

5853

5954

6055
[[configuration-uris-webtestclient]]
6156
==== WebTestClient URI Customization
6257

63-
When using WebTestClient, the default base for URIs documented by Spring REST
64-
Docs is `http://localhost:8080`. You can customize this base by using the
65-
{spring-framework-api}/org/springframework/test/web/reactive/server/WebTestClient.Builder.html#baseUrl-java.lang.String-[
66-
`baseUrl(String)` method on `WebTestClient.Builder`]. The following example shows how to
67-
do so:
58+
When using WebTestClient, the default base for URIs documented by Spring REST Docs is `http://localhost:8080`.
59+
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`].
60+
The following example shows how to do so:
6861

6962
====
7063
[source,java,indent=0]
@@ -79,9 +72,9 @@ include::{examples-dir}/com/example/webtestclient/CustomUriConfiguration.java[ta
7972
[[configuration-snippet-encoding]]
8073
=== Snippet Encoding
8174

82-
The default snippet encoding is `UTF-8`. You can change the default snippet encoding by
83-
using the `RestDocumentationConfigurer` API. For example, the following examples use
84-
`ISO-8859-1`:
75+
The default snippet encoding is `UTF-8`.
76+
You can change the default snippet encoding by using the `RestDocumentationConfigurer` API.
77+
For example, the following examples use `ISO-8859-1`:
8578

8679
====
8780
[source,java,indent=0,role="primary"]
@@ -103,18 +96,18 @@ include::{examples-dir}/com/example/restassured/CustomEncoding.java[tags=custom-
10396
----
10497
====
10598

106-
TIP: When Spring REST Docs converts the content of a request or a response to a `String`,
107-
the `charset` specified in the `Content-Type` header is used if it is available. In its
108-
absence, the JVM's default `Charset` is used. You can configure the JVM's default
109-
`Charset` byusing the `file.encoding` system property.
99+
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+
In its absence, the JVM's default `Charset` is used.
101+
You can configure the JVM's default `Charset` by using the `file.encoding` system property.
110102

111103

112104

113105
[[configuration-snippet-template-format]]
114106
=== Snippet Template Format
115107

116-
The default snippet template format is Asciidoctor. Markdown is also supported out of the
117-
box. You can change the default format by using the `RestDocumentationConfigurer` API.
108+
The default snippet template format is Asciidoctor.
109+
Markdown is also supported out of the box.
110+
You can change the default format by using the `RestDocumentationConfigurer` API.
118111
The following examples show how to do so:
119112

120113
====
@@ -151,9 +144,8 @@ Six snippets are produced by default:
151144
* `request-body`
152145
* `response-body`
153146

154-
You can change the default snippet configuration during setup by using the
155-
`RestDocumentationConfigurer` API. The following examples produce only the `curl-request`
156-
snippet by default:
147+
You can change the default snippet configuration during setup by using the `RestDocumentationConfigurer` API.
148+
The following examples produce only the `curl-request` snippet by default:
157149

158150
====
159151
[source,java,indent=0,role="primary"]
@@ -178,9 +170,8 @@ include::{examples-dir}/com/example/restassured/CustomDefaultSnippets.java[tags=
178170
[[configuration-default-preprocessors]]
179171
=== Default Operation Preprocessors
180172

181-
You can configure default request and response preprocessors during setup by using the
182-
`RestDocumentationConfigurer` API. The following examples remove the `Foo` headers from
183-
all requests and pretty print all responses:
173+
You can configure default request and response preprocessors during setup by using the `RestDocumentationConfigurer` API.
174+
The following examples remove the `Foo` headers from all requests and pretty print all responses:
184175

185176
====
186177
[source,java,indent=0,role="primary"]
+10-16
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
[[contributing]]
22
== Contributing
33

4-
Spring REST Docs is intended to make it easy for you to produce high-quality
5-
documentation for your RESTful services. However, we cannot achieve that goal without
6-
your contributions.
4+
Spring REST Docs is intended to make it easy for you to produce high-quality documentation for your RESTful services.
5+
However, we cannot achieve that goal without your contributions.
76

87

98

109
[[contributing-questions]]
1110
=== Questions
1211

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

1715

1816

1917
[[contributing-bugs]]
2018
=== Bugs
2119

22-
If you believe you have found a bug, please take a moment to search the
23-
{github}/issues?q=is%3Aissue[existing issues]. If no one else has reported the problem,
24-
please {github}/issues/new[open a new issue] that describes the problem in detail and,
25-
ideally, includes a test that reproduces it.
20+
If you believe you have found a bug, please take a moment to search the {github}/issues?q=is%3Aissue[existing issues].
21+
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.
2622

2723

2824

2925
[[contributing-enhancements]]
3026
=== Enhancements
3127

32-
If you would like an enhancement to be made to Spring REST Docs, pull requests are most
33-
welcome. The source code is on {github}[GitHub]. You may want to search the
34-
{github}/issues?q=is%3Aissue[existing issues] and {github}/pulls?q=is%3Apr[pull requests]
35-
to see if the enhancement has already been proprosed. You may also want to
36-
{github}/issues/new[open a new issue] to discuss a possible enhancement before work on it
37-
begins.
28+
If you would like an enhancement to be made to Spring REST Docs, pull requests are most welcome.
29+
The source code is on {github}[GitHub].
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+
You may also want to {github}/issues/new[open a new issue] to discuss a possible enhancement before work on it begins.

0 commit comments

Comments
 (0)