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.
- 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
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
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
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
- 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
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
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