Commit Graph

420 Commits

Author SHA1 Message Date
Spring Buildmaster
c0e950b3ee Next development version 2016-08-31 08:47:58 +00: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
21567e0ffa Simply dealing with operation names in REST Docs' own tests 2016-08-24 10:05:17 +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
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
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
bf9b0f2d64 Ensure that query string is not duplicated when parameters overlap
Closes gh-286
2016-07-29 21:10:21 +01:00
Andy Wilkinson
110fa23958 Configure sonar.branch 2016-07-25 14:53:54 +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
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
Andy Wilkinson
0540f98de8 Merge pull request #266 from Jennifer Strater
* gh-266:
  Split samples table into three tables grouped by type
2016-06-27 16:10:42 +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
Andy Wilkinson
30254ba6d5 Merge pull request #271 from Johnny Lim
* gh-271:
  Correct javadoc in LinksSnippet
2016-06-24 09:30:42 +01:00
Johnny Lim
c6f20f2138 Correct javadoc in LinksSnippet
Closes gh-271
2016-06-24 09:30:31 +01:00
Andy Wilkinson
8ca1dfa1ad Improve handling of requests with both parameters and content
Previously, if a MockMvc request was made with parameters and body
content, the parameters were omitted from the resulting curl, HTTPie
and HTTP request snippets.

This commit updates the affected snippets to ensure that the
parameters are included. The user-provided content is interpreted
as indicating that the parameters should be sent in the query string
rather than as form-encoded content.

Closes gh-239
2016-06-23 17:53:32 +01:00
Andy Wilkinson
37519398c7 Include customized Host header in curl and HTTPie request snippets
Previously, the curl and HTTPie request snippets always excluded the
Host header, relying on the Host header that’s auto-generated by curl
and HTTPie instead. This worked well for the most part, but meant that
incorrect snippets were generated when the request was being sent with
a custom host header that did not match the header that would be
auto-generated.

This commit updates CliOperationRequest to only filter out the Host
header if it’s the same as the header that would be auto-generated
by curl or HTTPie.

Closes gh-258
2016-06-23 15:52:30 +01:00
Andy Wilkinson
a4298b29e7 Include request URI’s port, if any, in default Host header
Previously, OperationRequestFactory would add a Host header if one did
not already exist in the request’s headers, however it did not include
the port. This meant that when the request was being made to a
non-standard port (a port other than 80 for an HTTP request and 443 for
an HTTPS request) the Host header was incorrect.

This commit updates OperationRequestFactory to check the URI for a port
and, if it has one, include it in the Host header.
UriModifyingOperationPreprocessor has also been updated to correctly
include the port in the Host header.

Closes gh-269
2016-06-23 15:45:11 +01:00
Andy Wilkinson
857525954b Update samples following the release of 1.1.0.RELEASE 2016-06-23 15:41:36 +01:00
Andy Wilkinson
41b7fd63f6 Fix RestAssuredRestDocumentationConfigurerTests.nextFilterIsCalled
The test wasn’t actually verifying that the next filter was being
called. This commit corrects that.
2016-06-16 13:14:43 +01:00
Spring Buildmaster
832f4fdbc3 Next development version 2016-05-31 10:53:12 +00:00
Andy Wilkinson
b804ebbe5a Add a description to the REST Assured module 2016-05-31 11:35:43 +01:00
Andy Wilkinson
686914071a Configure Grails sample to run tests using a random server port
See gh-250
2016-05-31 10:20:19 +01:00
Andy Wilkinson
d5a2dff210 Update the samples to use Spring Boot 1.3.5.RELEASE 2016-05-31 10:07:19 +01:00
Andy Wilkinson
4f87f55aaa Fix link to Spring Framework javadoc 2016-05-31 10:04:30 +01:00
Andy Wilkinson
8ca8c85d32 Merge pull request #250 from Jennifer Strater
* gh-250:
  Polish "Add Grails sample app" (1338df9)
  Add Grails sample app
2016-05-31 10:01:30 +01:00
Andy Wilkinson
34ec9d523d Polish "Add Grails sample app" (1338df9)
The sole structural change is to rearrange the build slightly so that,
like the other samples, the version of the Grails sample's REST Docs
dependency is automatically updated.

See gh-250
2016-05-31 10:00:52 +01:00
Jennifer Strater
64803b5fae Add Grails sample app
Closes gh-250
2016-05-31 10:00:40 +01:00
Andy Wilkinson
c1d245f7d4 Add link to restdocs-wiremock to the README
Closes gh-244
2016-05-25 14:18:55 +01:00
Andy Wilkinson
bec03a1f3f Merge branch '1.0.x' 2016-05-25 14:13:51 +01:00