28 Commits

Author SHA1 Message Date
Andy Wilkinson
81a07d4951 Use HTTPS linked in the README 2019-03-19 11:44:44 +00:00
Andy Wilkinson
75132b537a Use HTTPS to link to Apache license 2019-03-19 11:21:34 +00:00
Andy Wilkinson
29675728aa Introduce a code of conduct 2016-02-02 09:45:37 +00:00
Andy Wilkinson
8a0b07576d Update README and reference docs to avoid duplication of content 2015-06-24 11:45:30 +01:00
Andy Wilkinson
0c0d3b89bd Default snippet encoding to UTF-8 and make it configurable
Previously, snippets were written to disk using the JVM’s default
encoding. While this could be controlled by the file.encoding system
property it was not ideal as, if the proper was not always set, it could
lead to platform-dependent output being generated. Furthermore,
Asciidoctor uses UTF-8 encoding by default so there was a risk of the
snippets being generated in a different encoding to the encoding
expected by Asciidoctor.

This commit updates the configuration so that, by default, snippets are
encoded as UTF-8. The RestDocumentationConfigurer API has been enhanced
to allow this default to be configured as part of building the
MockMvc instance. This enhancement as brought with it a more fluent
configuration API that separates configuration that is related to URIs
from configuration that is related to snippets.

Closes gh-67
2015-05-13 11:18:56 +01:00
Andy Wilkinson
f93981fce2 Align with the Asciidoctor team's preferred file extension, .adoc
Closes gh-45
2015-04-16 12:31:29 +01:00
Andy Wilkinson
e00734d693 Add support for generating an HTTP request documentation snippet
Closes gh-13
2015-04-16 12:03:21 +01:00
Andy Wilkinson
1eeb605108 Support using alwaysDo to automatically document every MockMvc call
The MVC test framework provides an alwaysDo method which allows the
configuration of a result handler to be that will be invoked for every
call to perform. Previously, this method could not be used for
producing documentation snippets as the snippets would overwrite each
other.

This commit adds support for writing snippets to a parameterized
output directory. Two parameters are supported: method name and step.
Method name is the name of the currently executing test method. Step
is a count of the number of calls to MockMvc.perform that have been
made in that method.

Closes gh-14
2015-02-25 12:22:00 +00:00
Ronald Kurr
289ba57159 Update README to recommend that pretty printing of JSON is enabled
Closes gh-16
2015-02-24 11:54:33 +00:00
Andy Wilkinson
565a57e5da Update the README following rename of RestDocumentationConfiguration 2015-02-24 11:32:22 +00:00
Andy Wilkinson
ea77bd530a Document Spring Framework 4.1 as a requirement
Closes gh-20
2015-02-24 11:30:22 +00:00
Andreas Evers
35d4bc4d4f Update README after rename of spring-restdocs-core to spring-restdocs
Closes gh-22
2015-02-23 09:46:05 +00:00
Andy Wilkinson
cbae38d05d Update README with a link to video recording of the presentation 2015-02-16 17:02:54 +00:00
Andy Wilkinson
326abdaf79 Update README to reflect new location of the samples 2015-02-16 16:56:48 +00:00
Andy Wilkinson
f405848179 Document Gradle and Maven configuration for self-hosted documentation
Update the README to describe how to include the generated documentation
in a project’s jar file so that it can be served as static content by,
for example, Spring Boot.

Closes gh-12
2015-02-16 11:05:29 +00:00
Andy Wilkinson
530a218ab4 Correct the capitalisation of Asciidoctor in the README 2015-02-03 17:16:32 +00:00
Andy Wilkinson
5f49aa2732 Fix formatting of a code block in the README 2015-02-03 17:13:53 +00:00
Andy Wilkinson
8b2174cb84 Provide build status in the README 2015-01-08 18:11:40 +00:00
Andy Wilkinson
af93a32bde Reflect snapshots being available from https://repo.spring.io/snapshot
Update the README and the samples’ build.gradle and pom.xml files to
reflect snapshots now being available from
https://repo.spring.io/snapshot.

Closes #5
2015-01-08 18:06:38 +00:00
Andy Wilkinson
6ec522069a Make things less Gradle-specific and provide Maven config in samples
Previously, the project provided a Gradle plugin and was only really
intended for use with Gradle. This had influenced a number of design
choices that have proven to be less than ideal when attempting to
use the project with Maven.

This commit backs off from a number of design decisions that worked
well with Gradle but less so with Maven. Part of this is that the
Gradle plugin is (temporarily?) no more. It's been removed in favour
of configuring things directly in build.gradle. While this slightly
increases the amount of configuration required it makes things far
more flexible.

Both samples have been updated with modified Gradle configuration and
new Maven configuration. The README has also been updated to reflect
these changes.
2015-01-08 16:51:47 +00:00
Andy Wilkinson
23e8ad3dae Update the README to reflect the changes to how document is used 2014-12-02 12:20:40 +00:00
Rossen Stoyanchev
e98658266c Update README.md to include link to presentation
Rework the opening paragraph and include a link to the Documenting
RESTful APIs presentation given at Spring Exchange 2014.

Closes gh-2
2014-11-13 15:17:29 +00:00
Andy Wilkinson
d06095ee72 Provide API guide examples alongside existing getting started guides 2014-11-04 17:23:12 +00:00
Andy Wilkinson
3ac27976ea Fix indentation in the README 2014-10-28 15:27:56 +00:00
Andy Wilkinson
01e37f1e4f Remove CGLib proxy “magic” in favour of an explicit document method
Previously, the name of an output file was automatically determined
by the name of the method from which the mockMvc.perform call was made.
While (somewhat) clever, to support this for non @Test methods, this
required the use of a CGLib proxy to push and pop some context that
kept track of the name of the current method. This meant it only worked
for non-private methods. It also made it hard to look at the code and
see what would and would not be documented.

This commit updates the library to provide an explicit document method
instead. This method takes the path of an output directory and a
MockMvc ResultActions instance, typically returned from a call to
mockMvc.perform. For example:

document("index",
        this.mockMvc.perform(get("/").accept(MediaTypes.HAL_JSON))
		.andExpect(status().isOk()));

This will perform a GET request to "/", assert that the response is
200 OK and write documentation snippets for the request and response
to a directory named index.
2014-10-28 15:10:56 +00:00
Andy Wilkinson
aa81f348d7 Fix error in README's markup 2014-10-23 15:47:14 +01:00
Andy Wilkinson
d5afc5d6f2 Update the README to reflect new functionality 2014-10-23 13:43:19 +01:00
Andy Wilkinson
b7904bcad7 Initial commit 2014-10-08 14:04:52 +01:00