LinksSnippet extends AbstractJacksonFieldSnippet { public LinksSnippet documentationType(Type documentationType) { return new LinksSnippet(documentationType, failOnUndocumentedFields); } LinksSnippet();  LinksSnippet(Type documentationType, boolean failOnUndocumentedFields); LinksSnippet documentationType(Type documentationType); LinksSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields); @Override String getHeaderKey(Operation operation);  }
@Test public void links() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("addItem"); mockFieldComment(LinksDocs.class, "link1", "Link 1"); mockFieldComment(LinksDocs.class, "link2", "Link 2"); new LinksSnippet().documentationType(LinksDocs.class).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(ObjectMapper.class.getName(), mapper) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); assertThat(this.generatedSnippets.snippet(AUTO_LINKS)).is( tableWithHeader("Path", "Optional", "Description") .row("link1", "true", "Link 1.") .row("link2", "true", "Link 2.")); }