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
* gh-310:
Polish contribution and rework to use default attribute rather than macro
Provide a default output directory for snippets based on build tool
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
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
Previously, the logic that determined the field’s type would incorrectly
look at the contents of the array. For example, if the array contained
one or more objects, the field’s type would be resolved as Object rather
than Array.
This commit updates JsonFieldPath to record when a path explicitly
identifies an array so that the array itself is used to determine the
field’s type rather than its contents.
Closes gh-292
QueryStringParser has been moved into the operation page. In the
unlikely event that there were any external users of the class, a
deprecated version remains in the cli package for backwards
compatibility. It will be removed in 1.2.
Closes gh-286
Missing optional fields require a type to be explicitly provided as
it cannot be inferred from the payload. Ignored fields are not
included in the documentation, yet, previously, a field that was
missing, optional, and ignored would still require a type to be
provided otherwise the test would fail. This was pointless as the
field wasn't going to appear in the documentation.
This commit updates the fields snippets so that a type is no longer
required for a field that is missing, optional and ignored.
Closes gh-289
Previously, spring-restdocs-core had a dependency on spring-webmvc
however it only used classes from spring-web. This commit moves
the spring-webmvc dependency from spring-restdocs-core to
spring-restdocs-mockmvc where it's needed. It's now in the runtime
scope (rather than compile) as it's not needed at compile time but
is needed at runtime by the MockMvc support in spring-test.
Closes gh-273
Previously, RestAssuredRequestConverter only supported request and
request part content that was null, a String or a byte[]. This was
particularly problematic for multipart requests as RestAssured performs
some internal conversion which meant that, no matter what the when a
byte[] was provided it was wrapped in a ByteArrayInputStream meaning
that the converter could not read it.
The commit improves RestAssuredRequestConverter so that it will now
convert File content and InputStream content where the stream supported
reset().
Closes gh-252