Skip to content

Commit adbc880

Browse files
committed
Merge branch '2.0.x'
2 parents c60c87a + 87e7a7b commit adbc880

11 files changed

+496
-696
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

+22-29
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,22 +37,18 @@ 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-webtestclient]]
5047
==== WebTestClient URI Customization
5148

52-
When using WebTestClient, the default base for URIs documented by Spring REST
53-
Docs is `http://localhost:8080`. You can customize this base by using the
54-
{spring-framework-api}/org/springframework/test/web/reactive/server/WebTestClient.Builder.html#baseUrl-java.lang.String-[
55-
`baseUrl(String)` method on `WebTestClient.Builder`]. The following example shows how to
56-
do so:
49+
When using WebTestClient, the default base for URIs documented by Spring REST Docs is `http://localhost:8080`.
50+
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`].
51+
The following example shows how to do so:
5752

5853
====
5954
[source,java,indent=0]
@@ -68,9 +63,9 @@ include::{examples-dir}/com/example/webtestclient/CustomUriConfiguration.java[ta
6863
[[configuration-snippet-encoding]]
6964
=== Snippet Encoding
7065

71-
The default snippet encoding is `UTF-8`. You can change the default snippet encoding by
72-
using the `RestDocumentationConfigurer` API. For example, the following examples use
73-
`ISO-8859-1`:
66+
The default snippet encoding is `UTF-8`.
67+
You can change the default snippet encoding by using the `RestDocumentationConfigurer` API.
68+
For example, the following examples use `ISO-8859-1`:
7469

7570
====
7671
[source,java,indent=0,role="primary"]
@@ -85,18 +80,18 @@ include::{examples-dir}/com/example/mockmvc/CustomEncoding.java[tags=custom-enco
8580
include::{examples-dir}/com/example/webtestclient/CustomEncoding.java[tags=custom-encoding]
8681
----
8782
88-
TIP: When Spring REST Docs converts the content of a request or a response to a `String`,
89-
the `charset` specified in the `Content-Type` header is used if it is available. In its
90-
absence, the JVM's default `Charset` is used. You can configure the JVM's default
91-
`Charset` byusing the `file.encoding` system property.
83+
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.
84+
In its absence, the JVM's default `Charset` is used.
85+
You can configure the JVM's default `Charset` by using the `file.encoding` system property.
9286
9387
9488
9589
[[configuration-snippet-template-format]]
9690
=== Snippet Template Format
9791
98-
The default snippet template format is Asciidoctor. Markdown is also supported out of the
99-
box. You can change the default format by using the `RestDocumentationConfigurer` API.
92+
The default snippet template format is Asciidoctor.
93+
Markdown is also supported out of the box.
94+
You can change the default format by using the `RestDocumentationConfigurer` API.
10095
The following examples show how to do so:
10196
10297
====
@@ -126,9 +121,8 @@ Six snippets are produced by default:
126121
* `request-body`
127122
* `response-body`
128123

129-
You can change the default snippet configuration during setup by using the
130-
`RestDocumentationConfigurer` API. The following examples produce only the `curl-request`
131-
snippet by default:
124+
You can change the default snippet configuration during setup by using the `RestDocumentationConfigurer` API.
125+
The following examples produce only the `curl-request` snippet by default:
132126

133127
====
134128
[source,java,indent=0,role="primary"]
@@ -148,9 +142,8 @@ include::{examples-dir}/com/example/webtestclient/CustomDefaultSnippets.java[tag
148142
[[configuration-default-preprocessors]]
149143
=== Default Operation Preprocessors
150144
151-
You can configure default request and response preprocessors during setup by using the
152-
`RestDocumentationConfigurer` API. The following examples remove the `Foo` headers from
153-
all requests and pretty print all responses:
145+
You can configure default request and response preprocessors during setup by using the `RestDocumentationConfigurer` API.
146+
The following examples remove the `Foo` headers from all requests and pretty print all responses:
154147
155148
====
156149
[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)