Files
spring-restdocs/spring-restdocs-core
Andy Wilkinson 6bf1edcd09 Improve handling of null fields beneath an array
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
2017-07-01 11:07:38 +01:00
..