EmbeddedSnippet extends AbstractJacksonFieldSnippet { public EmbeddedSnippet documentationType(Type documentationType) { return new EmbeddedSnippet(documentationType, failOnUndocumentedFields); } EmbeddedSnippet();  EmbeddedSnippet(Type documentationType, boolean failOnUndocumentedFields); EmbeddedSnippet documentationType(Type documentationType); EmbeddedSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields); @Override String getHeaderKey(Operation operation);  }
@Test public void embedded() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("addItem"); mockFieldComment(EmbeddedDocs.class, "embedded1", "Resource 1"); mockFieldComment(EmbeddedDocs.class, "embedded2", "Resource 2"); new EmbeddedSnippet().documentationType(EmbeddedDocs.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_EMBEDDED)).is( tableWithHeader("Path", "Type", "Optional", "Description") .row("embedded1", "Array[Object]", "true", "Resource 1.") .row("embedded2", "Object", "true", "Resource 2.")); }