Previously, if an array contained objects where a field was sometimes
null and sometimes had a value of a consistent type, the type inferred
type was varies. Furthermore, it was not possible for the user to
specify a type other than varies as a mismatch would be detected.
This commit updates JsonFieldTypeResolver so that, when dealing with
an imprecise field path (i.e. a path for a field within an array),
null values that don't match the common type for the field are
ignored. This produces the following behavior when nulls are involved:
- All null fields results in the null type
- A mixture of nulls and a particular type results in the particular
type
- A mixture of nulls and two or more other types results in the varies
type
Closes gh-398
Previously, the included .adoc files did not consistently end with a
blank line. In certain cases, Asciidoctor requires a blank line before a
new section. As a result, the lack of blank lines meant that some
section headings did not appear correctly.
This commit updates each of the included .adoc files in the
documentation to ensure that each ends with a blank line.
Previously, when the operation block macro rendered the fragment
for a snippet, every top-level block in the fragment had its parent
set. Setting the parent has the side-effect of also setting the
block's document to be that of its parent. This meant that every
top-level block's document referred to the main document, but any
descendents were left with their document referring to the fragment
document. This did not cause a problem with the HTML backend (which
does not consider a block's document) but the PDF backend does
consider a block's document resulting in the descendents being
omitted from the generated PDF.
This commit updates the operation block macro to set the parent of
every block in the fragment to its correct value. This has the
side-effect of causing the block to update its document reference to
point to the main document.
Closes gh-396
Previously, the document fields in an XML payload, the request or
response had to have an application/xml content type. This prevented
documenting standard XML content types such as text/xml and
application/rss+xml as well as payloads with custom XML content types.
This commit updates the logic that sets up the ContentHandler to
first attempt to parse the content as JSON. If that fails it then
parses it as XML. If that fails an exception is thrown. This allows
any JSON or XML content, irrespective of the actual content type, to
be documented.
Closes gh-393
Previously, if the main project hadn't been installed in the local
Maven repository (./gradlew install), rest-notes-spring-data-rest
would fail to build as the plugin dependency,
spring-restdocs-asciidoctor, was not available.
This commit corrects the problem by adding
repo.spring.io/libs-snapshot as a plugin repository in addition to
its existing declaration as a "normal" repository.
Fixes gh-382
Closes gh-383
Previously, the use of compileOnly meant that the REST Assured
dependencies were omitted from pom for spring-restdocs-restassured.
This commit correct thr problem by using the propdeps' plugin's
optional configuration instead.
Closes gh-372