Commit Graph

489 Commits

Author SHA1 Message Date
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
86f6dbab9c Specify an ID for each section created by the operation macro
Closes gh-364
2017-03-08 09:45:02 +00:00
Andy Wilkinson
40fc211d9e Polishing 2017-03-07 18:42:01 +00:00
Andy Wilkinson
6f7be570f7 Another attempt at fixing OperationBlockMacroTests on Windows
It appears that Asciidoctor uses \n on all platforms but when the
expected content is read in on Windows it uses \r\n as the line
endings are being changed when Git performs the clone.
2017-03-07 18:37:27 +00:00
Andy Wilkinson
d3fdd0bef7 Fix OperationBlockMacroTests on Windows 2017-03-07 18:30:00 +00:00
Andy Wilkinson
347f14f617 Merge pull request #354 from Gerrit Meier
* gh-323:
  Polish “Provide a block macro for including an operation's snippets”
  Provide a block macro for including an operation's snippets
2017-03-07 17:29:50 +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
Gerrit Meier
18b559a839 Provide a block macro for including an operation's snippets
See gh-323
Closes gh-354
2017-03-07 16:46:57 +00:00
Andy Wilkinson
3cc6f2d7d5 Merge branch '1.1.x' 2017-03-05 17:28:45 +00:00
Andy Wilkinson
2fa0aa4472 Further tweaks to try and get builds on Travis to work reliably 2017-03-05 17:28:31 +00:00
Andy Wilkinson
73fac5ca31 Merge branch '1.1.x' 2017-03-05 16:23:56 +00:00
Andy Wilkinson
17acbb9fbf Upgrade Travis configuration to use a recent version of Oracle JDK 8
By default, Travis uses a rather old version of Oracle's JDK 8 in
its container-based infrastructure. It would appear that this is what
has been causing the build to fail with minimal diagnostics.

This commit implements a suggestion [1] to get a more recent version
of Java 8 by installing the oracle-java8-installer package via the APT
addon.

[1] https://github.com/travis-ci/travis-ci/issues/3259#issuecomment-130860338
2017-03-05 16:23:47 +00:00
Andy Wilkinson
ca86e3ad8c Upgrade Slate sample to Slate 1.5
Closes gh-361
2017-03-04 22:13:46 +00:00
Andy Wilkinson
3a0f4ab68e Fix the Slate sample's tests
Closes gh-339
2017-03-04 21:43:12 +00:00
Andy Wilkinson
e9ceeacd66 Merge branch '1.1.x' 2017-03-04 21:05:07 +00:00
Andy Wilkinson
727f6ccd78 Protect the tests against changes to MockMvc's HTTP header ordering
Closes gh-359
2017-03-04 20:45:47 +00:00
Andy Wilkinson
7cb91f9963 Remove use of Spring Boot from REST Assured module's integration tests
Closes gh-360
2017-03-04 20:40:42 +00:00
Andy Wilkinson
b6f986556e Upgrade to Gradle 3.4
Closes gh-283
2017-03-03 21:03:39 +00:00
Andy Wilkinson
31ad4b40a0 Upgrade the Grails sample to Grails 3.2.6
Closes gh-357
2017-03-03 16:57:55 +00:00
Andy Wilkinson
722048e20f Introduce RequestCookie to avoid core depending on the Servlet API
Closes gh-345
2017-02-03 14:55:18 +00:00
Andy Wilkinson
ccb31ecfb2 Merge pull request #336 from Tomasz Kopczynski
* gh-336:
  Polish "Include cookies in request snippets"
  Include cookies in request snippets
2017-02-02 14:56:59 +00:00
Andy Wilkinson
a9c1e04081 Polish "Include cookies in request snippets"
See gh-336

Closes gh-302
Closes gh-303
Closes gh-304
2017-02-02 14:50:22 +00:00
Tomasz Kopczynski
25bc6c37da Include cookies in request snippets
Closes gh-336
See gh-302, gh-303, gh-304
2017-02-02 14:49:45 +00:00
Andy Wilkinson
0337160e80 Merge pull request #343 from Florian Benz
* gh-343:
  Add spring-auto-restdocs to third-party extensions
2017-01-30 17:14:00 +00:00
Florian Benz
7e4a865d1b Add spring-auto-restdocs to third-party extensions
Closes gh-343
2017-01-30 17:13:05 +00:00
Andy Wilkinson
677a23647f Compile and test against Spring Framework 4.3.6.RELEASE
This commit upgrade to Spring Framework 4.3.6.RELEASE. A side-effect
of this change is that the Content-Type header is now always the first
header when building a request with MockMvc. One test has been updated
to reflect this change in ordering.

Closes gh-342
2017-01-25 20:00:36 +00:00
Andy Wilkinson
e2041333a6 Merge branch '1.1.x' 2016-12-16 14:45:10 +00:00
Andy Wilkinson
a19aef796f Merge pull request #329 from Gerrit Meier
* gh-329:
  Document that port is omitted when it matches the scheme's default
2016-12-16 14:41:37 +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
Andy Wilkinson
b7e4edf904 Merge pull request #334 from stonio
* gh-334:
  Clarify that parameterized output directory uses the simple class name
2016-12-16 14:33:26 +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
1393182182 Upgrade Spring Boot-based samples and integration tests to use 1.4
Closes gh-327
2016-10-28 21:25:30 +01: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
60211dab86 Polishing
- Pass attributes into RequestPartFieldsSnippet
 - Add missing package.info.java for new asciidoctor package
2016-10-25 16:10:58 +01:00
Andy Wilkinson
8035b91735 Merge pull request #270 from Mathieu Pousse
* gh-270:
  Polish "Add support for documenting request part payload fields"
  Add support for documenting request part payload fields
2016-10-25 15:56:55 +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
4f19294220 Allow a TemplatedSnippet to produce multiple snippets from same template
Previously a TemplatedSnippet could only write snippets with the
same name as its template. This meant that the same template could
not be used to produce multiple snippets with different names.

This commit separates the snippet name from the template name, thereby
allowing the snippet name to vary while the template name remains the
same. For backwards compatibility, the default behaviour is for the
template name and snippet name to remain the same. The new overloaded
constructor can be used when the names need to differ.

Closes gh-320
2016-10-25 15:35:20 +01:00
Andy Wilkinson
a603b9481e Merge branch '1.1.x' 2016-10-25 11:36:03 +01:00
Andy Wilkinson
60e1bdd5f4 Merge pull request #314 from Luis del Toro
* gh-314:
  Polish "Copy attributes when applying path prefix to field descriptors"
  Copy attributes when applying path prefix to field descriptors
2016-10-25 11:35:55 +01:00
Andy Wilkinson
7487f41363 Polish "Copy attributes when applying path prefix to field descriptors"
- Apply code formatting
 - Test copying of attributes (and other parts of a field descriptor)
   in new PayloadDocumentationTests

Closes gh-314
2016-10-25 11:34:09 +01:00
Luis del Toro
27b7553812 Copy attributes when applying path prefix to field descriptors
See gh-314
2016-10-25 11:34:09 +01:00
Andy Wilkinson
025cfe6742 Merge branch '1.1.x' 2016-10-22 22:06:51 +01:00
Andy Wilkinson
49596df0f3 Make snippet directory resolution more robust
The previous approach had (at least) two problems:

 - A Gradle build run from a directory that also contains a pom.xml
   would result in the resolver incorrectly identifing that Maven was
   being used
 - A Maven build run from a directory that did not could a pom and
   that used -f to provide the path to a pom would result in the
   resolver incorretly indentifying that Gradle was being used

With this commit, the resolver now uses the presence of the maven.home
system property to identify that Maven is being used. When Maven
is being used, rather than looking for a pom.xml in the working
directory, the resolver now locates the pom.xml by searching up the
directory hierarchy from the docdir.

Closes gh-297
2016-10-22 21:58:11 +01:00
Andy Wilkinson
c13b7d03f5 Fix DefaultAttributesPreprocessorTests on Windows 2016-10-21 23:26:18 +01:00