-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Currently, if links are marked as required, but are not formatted as HAL links, documentation generation will fail on the ResponseSnippet validation step. Spring REST docs itself allows providing a specific link extractor to handle different response formats. In the case which this was encountered for, the APIs in question are returning links in a specific format due to constraints outside my control, so aside from the compatibility and workload issues, converting to the more standard response style isn't an option, which is why for the standard REST doc operations we are providing a custom link extractor.
The issue specifically is in DescriptorValidator.LinksSnippetWrapper, which is currently hard-coded to use HypermediaDocumentation.halLinks(). Ideally, this would be an overridable default.
My suggestion to resolve this would be to add a linkExtractor field to ResourceSnippetParameters (and its builder) which defaults to HypermediaDocumentation.halLinks(), and is passed in as a parameter to the DescriptorValidator operation.