When multiple refs are present for one link, the link's content will not be an object with two properties (rel and href), but an array containing multiple of these.
The test will fail with the message:
org.springframework.restdocs.payload.FieldTypesDoNotMatchException: The documented type of the field '_links.multiple' is Object but the actual type is Array
Coverage remained the same at 93.585% when pulling 8362d7d42637125dabac2b5d13733cea5e721b4a on UlfS:fix/multiple-hrefs-in-links-not-working into afd9f1aca4710cc6154d7569d4adf586de689123 on ePages-de:master.
When multiple refs are present for one link, the link's content will not be an object with two properties (rel and href), but an array containing multiple of these. The test will fail with the message:
org.springframework.restdocs.payload.FieldTypesDoNotMatchException: The documented type of the field '_links.multiple' is Object but the actual type is Array
There is an additional
generateModel
pass, which includes validation of type information, but this time includingFieldDescriptor
s created fromLinkDescriptor
s. See https://github.com/ePages-de/restdocs-raml/blob/afd9f1aca4710cc6154d7569d4adf586de689123/restdocs-raml/src/main/java/com/epages/restdocs/raml/ResponseHandler.java#L46The expected type is set to
OBJECT
, which will beARRAY
when multiple hrefs for a link are present.