Commit Graph

242 Commits

Author SHA1 Message Date
Andy Wilkinson
4d44401efa Add a note in the documentation about use of the JVM's default charset
Closes gh-201
2016-02-15 12:43:32 +00:00
Andy Wilkinson
cfc413f7ed Avoid byte[] to String to byte[] conversion when pretty printing
Previously, PrettyPrintingContentModifier would convert the byte[]
content into a String and then back into a byte[]. It did so without
consideration for the content’s character set. As a result, it could
fail to preserve the correct character encoding.

This commit updates PrettyPrintingContentModifier to avoid converting
the content into a String and back into a byte[] and to work entirely
with byte arrays instead. Removing the intermediate String from the
process removes the possibility of the content becoming corrupted.

Closes gh-202
2016-02-15 12:28:07 +00:00
Andy Wilkinson
74f9e272fd Apply Eclipse Mars' code formatting 2016-02-15 12:15:40 +00:00
Andy Wilkinson
811e7adf70 Add missing package-info.java for config package 2016-02-08 11:49:04 +00:00
Andy Wilkinson
29675728aa Introduce a code of conduct 2016-02-02 09:45:37 +00:00
Andy Wilkinson
068e59608d Merge pull request #186 from Martin Hock
* gh-186:
  Fix String comparison in HttpRequestSnippet
2016-01-29 13:55:10 +00:00
mnhock
5dbb31f38a Fix String comparison in HttpRequestSnippet
Closes gh-186
2016-01-29 13:54:16 +00:00
Andy Wilkinson
9dfa0b5385 Polish PatternReplacingContentModifier 2016-01-29 11:15:45 +00:00
Andy Wilkinson
2b21e8e766 Merge pull request #188 from Grant Hutchins
* gh-188:
  Fix typo
2016-01-27 17:19:12 +00:00
Grant Hutchins
d55b5b7738 Fix typo
Closes gh-188
2016-01-27 17:18:57 +00:00
Andy Wilkinson
97ae7a9ce9 Fix javadoc problem with use of em dash 2016-01-26 12:51:37 +00:00
Andy Wilkinson
d184425216 Polishing 2016-01-26 12:38:34 +00:00
Andy Wilkinson
02fa42445f Make consistent use of the diamond operator with generic types 2016-01-26 11:14:29 +00:00
Andy Wilkinson
08b24e0496 Remove redundant Eclipse metadata 2016-01-19 13:36:20 +00:00
Andy Wilkinson
82a5b96b69 Update the default copyright header for 2016 2016-01-19 13:28:19 +00:00
Andy Wilkinson
194e62bde3 Remove assumption that working directory will be the project’s root
The plugin for building the samples assumed that the current working
directory would be the directory containing the project’s build.gradle.
While this is generally true on the command line (it isn’t if
-project-dir is used), it isn’t true in Gradle’s IDE integration. This
was leading to an NPE as the sampleBuild task was being configured
to depend on a null task as a result of not finding the sample’s pom.xml
or build.grade file.

This commit corrects the main build.gradle to configure each sample’s
working directory relative to the root project’s directory, rather
than relying on the working directory. It also improves
SampleBuildConfigurer so that it will throw an exception if it fails to
find a sample’s build.gradle or pom.xml rather than continuing
and triggering an NPE inside Gradle.

Closes gh-185
2016-01-17 20:25:21 +00:00
Andy Wilkinson
99a2e4f0e0 Update the samples to build against 1.0.2 snapshots 2015-12-10 09:55:36 +00:00
Spring Buildmaster
83e56f68ab Next development version 2015-12-10 01:43:58 -08:00
Andy Wilkinson
437d2bcbce Uniquely identify the 1.0.x branch in Sonar 2015-12-09 21:15:44 +00:00
Andy Wilkinson
f6f4b77331 Upgrade the samples to use the latest Asciidoctor plugins 2015-12-09 10:52:19 +00:00
Andy Wilkinson
939769db11 Upgrade the samples to Spring Boot 1.2.7.RELEASE 2015-12-09 10:50:20 +00:00
Andy Wilkinson
88d3e72ae9 Upgrade to Spring Framework 4.1.8.RELEASE 2015-12-09 10:48:56 +00:00
Johnny Lim
a3c3bef093 Fix the link in the documentation to the default snippet templates
Closes gh-160
2015-12-03 17:54:43 +00:00
Andy Wilkinson
e8cf957f15 Update documentation to mention that you can write custom preprocessors
Closes gh-156
2015-12-03 17:50:34 +00:00
Andy Wilkinson
7a819b15b6 Make it clear that JSON array responses can be documented
Closes gh-163
2015-12-03 17:39:00 +00:00
Andy Wilkinson
c559efb81b Provide examples for JUnit rule configuration with both Maven and Gradle
Closes gh-162
2015-12-03 16:02:16 +00:00
Andy Wilkinson
310639a4cc Merge branch 'gh-167' into 1.0.x 2015-11-16 17:48:51 +00:00
Andy Wilkinson
acb87b98b8 Improve testing of XML attribute handling
Closes gh-166
2015-11-16 17:47:07 +00:00
cschaetzlein
58b992d99e Allow individual attributes in an XML element to be documented
Documenting an XML attribute in the XML payload leads to a
NullPointerException since no parent nodes exists for an XML
attribute. Rather than always trying to remove a node from its parent,
this commit changes the logic to apply special treament to nodes that
are attributes and remove the attribute from its owning element
instead.

Closes gh-167
2015-11-16 17:46:22 +00:00
Andy Wilkinson
75085477b6 Suppress unwanted output to System.err when pretty printing content
Previously, when the XML pretty printer attempted to pretty print
the content of a request or response it would output an error to
System.err if the content was not valid XML. While, benign, this
output was distracting.

This commit updates the XML pretty printer to suppress its output to
System.err by configuring it with an ErrorHandler and an ErrorListener
that swallow any errors of which they are notified.

Closes gh-153
2015-10-22 10:04:56 +01:00
Andy Wilkinson
9a3e4c5f70 Update the samples to build against 1.0.1 snapshots 2015-10-22 10:04:56 +01:00
Andy Wilkinson
69f6b40e28 Correct the links in the documentation to the samples on GitHub
Closes gh-147
2015-10-09 09:43:34 +01:00
Spring Buildmaster
260ffeebba Next development version 2015-10-07 05:48:20 -07:00
Andy Wilkinson
cfcc43c482 Ensure that generated poms contain <name> and <description> 2015-10-07 11:48:09 +01:00
Andy Wilkinson
6debc593e5 Don't apply to Spring IO Plugin to the docs project 2015-10-07 10:38:50 +01:00
Andy Wilkinson
0213c9e6fd Add the Spring IO plugin to the build 2015-10-07 09:47:21 +01:00
Andy Wilkinson
6443ed177e Fix building Maven sample on Windows 2015-10-06 17:48:30 +01:00
Andy Wilkinson
75e965c782 Correct the name of the mvnw script on Windows 2015-10-06 17:15:47 +01:00
Andy Wilkinson
9a362abe77 Update reference to mvnw.bat when building samples on Windows 2015-10-06 17:07:46 +01:00
Andy Wilkinson
f07f23ec85 Update versions of various dependencies 2015-10-06 16:49:07 +01:00
Andy Wilkinson
c97efcce2e Use the Maven Wrapper in the Spring Data REST-based sample
Closes gh-146
2015-10-06 16:41:34 +01:00
Andy Wilkinson
a693d12ce0 Polish the documentation 2015-10-06 16:29:23 +01:00
Andy Wilkinson
723b7a284f Use default location for .adoc source in Gradle-based sample
Previously both samples supported Maven and Gradle. Due to the different
default locations between the two build systems, the Gradle-based sample
was configured to use Maven’s default location for its .adoc files.

The samples have now been updated so that one sample uses Maven and the
other uses Gradle. However, when this change was made, the customization
of the Gradle-based sample’s .adoc file location wasn’t removed.

This commit updates the Gradle-based sample to use the default location,
src/docs/asciidoc, for its .adoc source files.

Closes gh-145
2015-10-05 10:22:55 +01:00
Andy Wilkinson
2730a7ceef Polishing 2015-09-30 19:28:43 +01:00
Andy Wilkinson
fb01a26a16 Allow an item to be undocumented without it causing a test failure
Previously, it was necessary to document every payload field, link,
path parameter, or request. If an item was not documented a failure
would occur. This has proven to be too restrictive for some use cases,
for example splitting up the documentation of a payload’s fields. While
it was possible to use a preprocessor to modify the operation prior to
documentation to remove the items that should not be documented, this
was more difficult than it needed to be.

This commit adds support for marking a descriptor as ignored. Ignored
descriptors count when checking that everything has been documented but
do not actually appear in the generated documentation.

Closes gh-143
2015-09-30 17:53:57 +01:00
Andy Wilkinson
7919845e8a Merge branch 'gh-71' 2015-09-29 13:05:50 +01:00
Andy Wilkinson
ea8f736259 Polish contribution that added support for documenting HTTP headers
The main changes are:

- Update javadoc to align with changes made in 5a01016
- Update documentation with details of the new support for documenting
  HTTP headers
- Add tests to verify that HTTP headers are matched case-insensitively

Closes gh-71
2015-09-29 13:03:27 +01:00
andreasevers
48f4d1343a Add support for documenting HTTP headers
This commit adds support for documenting HTTP headers in both requests
and responses.

Closes gh-140
2015-09-29 12:55:26 +01:00
Andy Wilkinson
5a010160a1 Polish Snippet-related javadoc
Closes gh-136
2015-09-28 20:18:37 +01:00
Andy Wilkinson
0d2c24ccc1 Improve curl request snippet's handling of query parameters
Previously, if a request had no content and it was a POST or a PUT
request, the curl request snippet would use the request's parameters
as application/x-www-form-urlencoded data sent using the -d option.
This resulted in the wrong snippet being produced if those parameters
had actually come from the request's query string.

This commit enhances CurlRequestSnippet so that, when it's using the
request's parameter's to create its content, it only includes
parameters that are not specified in the query string. With these
changes in place, this MockMvc request:

post("/?foo=bar").param("foo", "bar").param("a", "alpha")

Will produce a curl snippet with the following command:

$ curl 'http://localhost:8080/?foo=bar' -i -X POST -d 'a=alpha'

foo=bar only appears in the command's query string, despite also
being a general request parameter, and a=alpha only appears in the
request's data.

Closes gh-139
2015-09-28 17:23:22 +01:00