Commit Graph

112 Commits

Author SHA1 Message Date
Andy Wilkinson
dff9062a32 Fix formatting problems in the documentation
Previously, the included .adoc files did not consistently end with a 
blank line. In certain cases, Asciidoctor requires a blank line before a
new section. As a result, the lack of blank lines meant that some
section headings did not appear correctly.

This commit updates each of the included .adoc files in the
documentation to ensure that each ends with a blank line.
2017-06-30 19:56:56 +01:00
ooz
a8d51da4f4 Fix formatting of reference to HeaderDocumentation in the docs
Closes gh-409
2017-06-30 19:56:08 +01:00
Andy Wilkinson
a996041384 Merge branch '1.1.x' 2017-05-11 15:17:41 +01:00
Andy Wilkinson
b00b13fed5 Upgrade to spring-asciidoctor-extensions 0.1.1.RELEASE 2017-05-11 15:17:30 +01:00
Andy Wilkinson
cf77eabe04 Use code block switch extension from separate project
This should have been merged forwards following the changes in
70df55d413.

See gh-229
2017-05-11 15:15:00 +01:00
JD
9d4a118993 Add missing quotes around value of snippets attribute
Closes gh-389
2017-04-26 14:47:52 +01:00
Tomasz Kopczynski
30fa6bcc5f Include request body and response body default snippets list
Closes gh-379
2017-04-10 09:32:38 +01:00
Johnny Lim
dd00ce05aa Fix typo in Asciidoctor attributes configuration
Closes gh-377
2017-03-31 11:36:51 +01:00
Andy Wilkinson
ea20363c62 Merge branch '1.1.x' 2017-03-23 12:36:19 +00:00
Andy Wilkinson
b6120cd539 Fix broken cross-reference 2017-03-23 12:33:09 +00:00
Andy Wilkinson
b1227ce019 Remove recommendation about tweaking Surefire's configuration
Configuring Surefire to run tests found in files ending in
Documentation.java has the unwanted side-effect of switching off its
defaults, i.e. you end up with your documentation tests being run and
nothing else. While using a specific name for your documentation tests
can make them easier to identify, it isn't required. The documentation
also doesn't explicitly recommend using a Documentation suffix.

This commit simplifies things by removing the configuration that
changes Surefire's default inclusions.

Closes gh-368
2017-03-23 12:19:08 +00:00
Andy Wilkinson
ab1613ed63 Add support for using a wildcard when documenting a payload field
Closes gh-265
2017-03-23 11:05:48 +00:00
Andy Wilkinson
78982cf515 Add support for REST Assured 3
Closes gh-262
2017-03-20 21:39:25 +00:00
Andy Wilkinson
5a76decc11 Link to correct branch on GitHub in snapshot documentation
Closes gh-367
2017-03-08 13:07:09 +00:00
Andy Wilkinson
70df55d413 Use code block switch extension from separate project
Closes gh-229
2017-03-08 13:04:27 +00:00
Andy Wilkinson
a4d2fc39d8 Allow snippet section titles to be customized using document attributes
Closes gh-363
2017-03-08 10:41:54 +00:00
Andy Wilkinson
826e0a5dec Polish “Provide a block macro for including an operation's snippets”
- Copy snippets used in the tests in @BeforeClass rather than using
   Gradle so that the tests can be run easily in an IDE
 - Address problems in operation_block_macro.rb reported by Rubocop
 - Rename new test class to more closely match the name of the Ruby
   class that it’s testing
 - Gracefully handle a missing operation
 - Align behaviour when an operation or snippet is missing more closely
   with Asciidoctor’s behaviour when an include references a missing
   file
 - Use kebab-case rather than snake_case for new test resources
 - Update the documentation to describe the new macro

See gh-354
Closes gh-323
2017-03-07 17:27:29 +00:00
Andy Wilkinson
e2041333a6 Merge branch '1.1.x' 2016-12-16 14:45:10 +00:00
Gerrit Meier
2fb3ede3a6 Document that port is omitted when it matches the scheme's default
Closes gh-325
Closes gh-329
2016-12-16 14:41:30 +00:00
Andy Wilkinson
de39e5b85c Merge branch '1.1.x' 2016-12-16 14:33:50 +00:00
stonio
9bbb60ac2a Clarify that parameterized output directory uses the simple class name
Closes gh-334
2016-12-16 14:32:35 +00:00
Andy Wilkinson
dec3727da1 Add support for documenting body of a request, response or request part
Closes gh-318
Closes gh-319
2016-10-31 16:34:08 +00:00
Andy Wilkinson
88d5e9192e Merge branch '1.1.x' 2016-10-28 16:20:01 +01:00
Andy Wilkinson
7ff45d273e Call the right endpoint in REST Assured field reuse example
Closes gh-324
2016-10-28 16:19:19 +01:00
Andy Wilkinson
cbd96f301d Update field snippets to no longer document whole subsection by default
Previously, when a field was documented it would implicitly document
the whole subsection of the payload identified by that field. This
could lead to users inadvertently failing to document part of the
payload. Arguably, this was a bug as it violated REST Docs' principle
of producing accurate, detail documentation. However, fixing it
requires a breaking change as people may also be relying on this
behaviour. A balance needed to be struck so the fix is being made in
a minor release.

This commit introduces a new subsectionWithPath method which returns a
SubsectionDescriptor; a specialisation of FieldDescriptor. Users
that were intentionally relying on the old behaviour will have to
replace some usage of fieldWithPath with subsectionWithPath instead.
Users who were unintentionally relying on the old behaviour will have
to add some additional descriptors produced using fieldWithPath and
will receive more accurate documentation in return.

Closes gh-274
2016-10-28 16:12:07 +01:00
Andy Wilkinson
7bcfbd9e35 Add support for documenting a portion of a request or response payload
Closes gh-312
2016-10-27 10:26:46 +01:00
Andy Wilkinson
d2a5b38c83 Polish "Add support for documenting request part payload fields"
- Rebase on latest code, and make use of new support for the same
  TemplatedSnippet producing multiple snippets with different names
  from the same template
- Expand the documentation
- Apply code formatting
- Add support for relaxed documentation of a request part's fields

Closes gh-270
2016-10-25 15:56:47 +01:00
Mathieu POUSSE
13e745a9a9 Add support for documenting request part payload fields
See gh-270
2016-10-25 15:56:43 +01:00
Andy Wilkinson
a2f1391fc8 Merge branch '1.1.x' 2016-10-21 23:11:29 +01:00
Andy Wilkinson
0c64c781f4 Improve styling of groovy and adoc code blocks in the documentation
Closes gh-317
2016-10-21 23:09:47 +01:00
Andy Wilkinson
319bd139fc Polish contribution and rework to use default attribute rather than macro
Rather than introducing a custom macro, this commit opts to implicitly
configure the snippets attribute instead. The attribute is configured
will the path into which snippets are generated, relative to the
directory that contains the Asciidoctor document that is being
rendered.

The samples and documentation have been updated to use the new
spring-restdocs-asciidoctor module and the implicitly configured
snippets attribute.

Closes gh-297
2016-10-21 22:42:11 +01:00
Gerrit Meier
3ac4a1acad Provide a default output directory for snippets based on build tool
Rather than requiring an output directory to be explcitly configured,
a default is now automatically configured based on the build tool
that's being used. When using Gradle, snippets will be generated in
build/generated-snippets. When using Maven, snippets will be
generated in target/generated-snippets.

See gh-297
2016-10-21 22:26:58 +01:00
Andy Wilkinson
f2717363f0 Raise the minimum Spring Framework version to 4.3.x
Closes gh-284
2016-07-26 12:09:20 +01:00
Andy Wilkinson
3dceea8bb5 Document the tableCellContent Mustache lambda
Closes gh-251
2016-07-22 14:19:13 +01:00
Andy Wilkinson
9c97c8b9bf Polish "Improve documention on how to use .adoc snippets"
See gh-279
2016-07-22 10:51:11 +01:00
mle
eb46eaa3c5 Improve documention on how to use .adoc snippets
Closes gh-279
2016-07-22 10:47:13 +01:00
Jennifer Strater
a1d5d75c4e Split samples table into three tables grouped by type
Closes gh-266
2016-06-27 16:08:36 +01:00
Jennifer Strater
64803b5fae Add Grails sample app
Closes gh-250
2016-05-31 10:00:40 +01:00
Andy Wilkinson
0446c99a10 Polishing
- Correct copyright years
- Add `@since` to javadoc of new public classes
- Make new classes final where appropriate
2016-05-25 11:26:02 +01:00
Andy Wilkinson
42353a0b5f Improve the API for generating additional snippets
Previously, if alwaysDo was used and the user wanted to generate
one or more additional snippets when calling perform a separate call
to `snippets` was made prior to calling `perform`. This had two
problems:

 - it required the result handler to be stateful (see gh-243)
 - it wasn't clear that the additional snippets would be produced when
   a subsequent call to perform was made

This commit introduces a new API that allows the additional snippets
to be specified within the MockMvc call. The old API has been
deprecated and will be removed in 2.0.

Closes gh-249
2016-05-25 11:01:48 +01:00
Johnny Lim
09c9cac857 Polish 2016-05-24 13:23:14 +01:00
Andy Wilkinson
fc3ae3b4a2 Add support for documenting the parts of a multipart request
Closes gh-161
2016-05-12 16:30:36 +01:00
Andy Wilkinson
d362f3f41f Document support for relaxed snippets
Closes gh-223
2016-05-05 14:47:03 +01:00
Andy Wilkinson
60a02a431f Improve documentation of project's requirements
Closes gh-217
2016-05-05 14:37:58 +01:00
Andy Wilkinson
5e2552f8c4 Merge branch '1.0.x' 2016-05-05 12:48:23 +01:00
Andy Wilkinson
6a5fd53910 Update Asciidoctor dependencies 2016-05-05 12:47:22 +01:00
Andy Wilkinson
0e52ef04a1 Document how to ignore common links without repetition
Closes gh-177
2016-04-22 11:18:27 +01:00
Andy Wilkinson
b62c5f0374 Make it easier to document common portions of req and resp payloads
This commit adds a new andWithPrefix(String, FieldDescriptor[]) method
to both RequestFieldsSnippet and ResponseFieldsSnippet. It can be
used to add descriptors to an existing snippet, applying the given
prefix to the additional descriptors as it does so. This allows the
descriptors for a portion of a payload to be created once and then
reused, irrespective of where in the payload the portion appears.

Closes gh-221
2016-04-22 10:30:52 +01:00
Andy Wilkinson
2897b8d1b4 Provide a preprocessor for modifying a request’s parameters
Closes gh-155
2016-04-13 17:50:19 +01:00
Andy Wilkinson
c4b7438708 Derive a link's description from its title
Previously, a LinkDescriptor had to be created with both a rel and a
description. If a description was not provided a failure would occur.

This commit relaxes the above-described restriction by allowing a
link's title to be used as its default description. If a descriptor
has a description, it will always be used irrespective of whether or
not the link has a title. If the descriptor does not have a
description and the link does have a title, the link's title will be
used. If the descriptor does not have a description and the link does
not have a title a failure will occur.

Closes gh-105
2016-04-13 16:16:15 +01:00