Commit Graph

14 Commits

Author SHA1 Message Date
Andy Wilkinson
8e2fc7f45d Provide support for documenting path parameters
This commit adds support for documenting a request's path parameters.
For example:

mockMvc.perform(
		get("/locations/{latitude}/{longitude}", 51.5072, 0.1275))
			.andExpect(status().isOk())
			.andDo(document("locations").withPathParameters(
					parameterWithName("latitude")
							.description("The location's latitude"),
					parameterWithName("longitude")
							.description("The location's longitude")
			));

Closes gh-86
2015-07-29 14:50:49 +01:00
Andy Wilkinson
1175ca91e2 Fix package tangles 2015-07-28 16:16:46 +01:00
Andy Wilkinson
02c6c89172 Allow documentation of extra attributes that apply to the whole snippet
This commit adds support for associating custom attributes with the
generation of a particular snippet. The attributes are included in
the model during snippet rendering allowing them to be referenced from
a custom snippet template. Among other things, this makes it possible
to provide a configurable title for snippets that produce a code
block.

Closes gh-77
2015-07-28 11:05:28 +01:00
Andy Wilkinson
70824aa509 Allow documentation of extra attributes on fields, links, and query parameters
This commit adds support for associating custom attributes with field,
link, and query parameter descriptors. These attributes are then
included in the model during snippet rendering. Coupled with a custom
snippet template, this enables the inclusion of extra column(s) in the
generated tables.

Closes gh-70
2015-07-28 11:05:22 +01:00
Andy Wilkinson
4f850cddd9 Use a template engine to produce the documentation snippets
This commit introduces a new TemplateEngine abstraction that is used
to produce the documentation snippets. A default JMustache-based
implementation is provided. JMustache has been repackaged and embedded
to prevent unwanted conflicts and side-effects.

By default, snippet templates are loaded from the classpath in the
org.springframework.restdocs.templates package. Default snippet
templates are provided for all of the snippets that can be generated.
Each of these templates is named after the snippet that it will
produce – the snippet {name}.adoc is produced by the snippet template
default-{name}.snippet. A snippet named {name}.snippet, if present,
will be used in preference to the default snippet, thereby allowing
the default snippets to be overriden.
2015-07-28 10:54:07 +01:00
izeye
6f4fe4ea64 Polish documentation
Closes gh-98
2015-07-27 11:51:04 +01:00
Andy Wilkinson
5d44015e7d Improve description of when fields are considered to be documented
Closes gh-82
2015-07-13 17:46:21 +01:00
Andy Wilkinson
8a0b07576d Update README and reference docs to avoid duplication of content 2015-06-24 11:45:30 +01:00
Andy Wilkinson
1ae014dc53 Update build script examples in docs to use dynamic dependency version 2015-06-24 09:38:58 +01:00
Andy Wilkinson
9824e8a198 Include the version in the documentation's header 2015-06-23 18:00:37 +01:00
Andy Wilkinson
7cdbf0cea9 Add a section to the docs that provides tips on working with Asciidoctor
Closes gh-75
2015-06-23 14:02:18 +01:00
Andy Wilkinson
aeb88eb313 Update the documentation to reflect that links can now be optional
Closes gh-74
2015-06-17 13:44:26 +01:00
Andy Wilkinson
833f0eabb8 Polishing: replace spaces with tabs in doc examples
See gh-37
2015-06-16 17:21:43 +01:00
Andy Wilkinson
8307fb5428 Add reference documentation and create docs zip
Add reference documentation for the project and add a docs artifact
that contains both the reference documentation and the javadoc.

See gh-37
2015-06-16 17:14:31 +01:00