Commit Graph

439 Commits

Author SHA1 Message Date
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
Andy Wilkinson
2f568c2121 Install spring-restdocs-asciidoctor before building samples 2016-10-21 23:12:11 +01:00
Andy Wilkinson
a2f1391fc8 Merge branch '1.1.x' 2016-10-21 23:11:29 +01:00
Andy Wilkinson
3162241d4a Merge pull request #310 from Gerrit Meier
* gh-310:
  Polish contribution and rework to use default attribute rather than macro
  Provide a default output directory for snippets based on build tool
2016-10-21 22:43:51 +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
c1540838a3 Merge branch '1.1.x' 2016-08-24 13:02:44 +01:00
Andy Wilkinson
0f1f84e6a6 Fix JSON field type resolution for top-level and nested array fields
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
2016-08-24 13:02:21 +01:00
Andy Wilkinson
4e4d01a459 Consolidate logic in test rules for getting output dir and operation name 2016-08-24 12:49:51 +01:00
Andy Wilkinson
5913eb0c70 Merge branch '1.1.x' 2016-08-24 10:05:58 +01:00
Andy Wilkinson
21567e0ffa Simply dealing with operation names in REST Docs' own tests 2016-08-24 10:05:17 +01:00
Andy Wilkinson
523e3208c2 Merge branch '1.1.x' 2016-08-19 20:16:09 +01:00
Andy Wilkinson
14dcdb61d0 Fix package tangle between cli and operation packages
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
2016-08-19 20:14:20 +01:00
Andy Wilkinson
2e9152ae92 Merge branch '1.1.x' 2016-08-19 19:53:06 +01:00
Andy Wilkinson
5c6cf7f12f Polishing 2016-08-19 19:52:25 +01:00
Andy Wilkinson
a0faebdb0a Ignore query string when extracting path parameters
Closes gh-285
2016-08-19 19:52:23 +01:00
Andy Wilkinson
9ba0a9b6be Stop field snippets requiring a type for missing, optional, ignored field
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
2016-08-19 19:52:14 +01:00
Andy Wilkinson
e8ee583bd7 Merge branch '1.1.x' 2016-08-10 17:23:05 +01:00
Andy Wilkinson
ec3a05926e Merge branch '1.0.x' into 1.1.x 2016-08-10 17:22:58 +01:00
Andy Wilkinson
b430a88796 Polishing 2016-08-10 17:08:18 +01:00
Andy Wilkinson
8bcfb49219 Merge branch '1.1.x' 2016-07-29 21:11:14 +01:00
Andy Wilkinson
bf9b0f2d64 Ensure that query string is not duplicated when parameters overlap
Closes gh-286
2016-07-29 21:10:21 +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
65571d98dd Revert "Upgrade to Gradle 2.14.1"
This reverts commit 5c74bef194 and
commit 10e421a105.

See gh-283
2016-07-25 18:01:55 +01:00
Andy Wilkinson
10e421a105 Upgrade the samples that use Gradle to 2.14.1 as well
See gh-283
2016-07-25 15:39:12 +01:00
Andy Wilkinson
445423f9c5 Merge branch '1.1.x' 2016-07-25 14:54:10 +01:00
Andy Wilkinson
110fa23958 Configure sonar.branch 2016-07-25 14:53:54 +01:00
Andy Wilkinson
5c74bef194 Upgrade to Gradle 2.14.1
Closes gh-283
2016-07-25 14:36:25 +01:00
Andy Wilkinson
6234cd328c Merge branch '1.1.x' 2016-07-25 14:36:15 +01:00
Andy Wilkinson
67d31fd7d9 Upgrade to Jacoco 0.7.7.201606060606
Closes gh-282
2016-07-25 14:29:52 +01:00
Andy Wilkinson
2db7ab5e71 Start work on 1.2.0 2016-07-25 11:08:36 +01:00
Andy Wilkinson
d919238023 Update the samples following the release of 1.1.1.RELEASE 2016-07-25 11:06:49 +01:00
Spring Buildmaster
8a91f17054 Next development version 2016-07-25 09:24:28 +00:00
Andy Wilkinson
6c6054178e Upgrade tests and samples to use Spring Boot 1.3.6.RELEASE 2016-07-22 14:41:45 +01:00
Andy Wilkinson
3ec945fe58 Make it clearer how to use RestDocumentationResultHandler.document
Closes gh-255
2016-07-22 14:30:09 +01:00
Andy Wilkinson
3dceea8bb5 Document the tableCellContent Mustache lambda
Closes gh-251
2016-07-22 14:19:13 +01:00
Andy Wilkinson
78318775e0 Cause a failure when field's documented and actual types do not match
Closes gh-276
2016-07-22 13:20:44 +01:00
Andy Wilkinson
86c2310b90 Improve message when fields cannot be documented due to empty body
Closes gh-278
2016-07-22 11:44:43 +01:00
Andy Wilkinson
6131730621 Merge pull request #279 from mle-enso
* gh-279:
  Polish "Improve documention on how to use .adoc snippets"
  Improve documention on how to use .adoc snippets
2016-07-22 10:56:32 +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
Andy Wilkinson
f77864b094 Merge pull request #280 from Johnny Lim
* gh-280:
  Remove unnecessary Host header set in UriModifyingOperationPreprocessor
2016-07-22 10:18:24 +01:00
Johnny Lim
19d7337e26 Remove unnecessary Host header set in UriModifyingOperationPreprocessor
Closes gh-280
2016-07-22 10:17:58 +01:00
Andy Wilkinson
4f00cebaae Adopt the new CLA signing process 2016-07-11 10:47:14 +01:00
Andy Wilkinson
a3159b6f1c Update README to link to restdocsext-jersey third-party extension 2016-07-05 15:37:22 +01:00
Andy Wilkinson
0a0136ca58 Move spring-webmvc dependency to where it's needed
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
2016-07-05 12:49:17 +01:00
Andy Wilkinson
417547e61a Support more types of content in RestAssuredRequestConverter
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
2016-06-28 11:17:37 +01:00
Andy Wilkinson
61226b5619 Merge pull request #268 from Jennifer Strater
* gh-268:
  Add README to Grails sample
2016-06-27 16:25:10 +01:00
Jennifer Strater
42613bf3f9 Add README to Grails sample
Closes gh-254
Closes gh-268
2016-06-27 16:25:04 +01:00