JacksonRequestFieldSnippet extends AbstractJacksonFieldSnippet { public JacksonRequestFieldSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields) { return new JacksonRequestFieldSnippet(requestBodyType, failOnUndocumentedFields); } JacksonRequestFieldSnippet();  JacksonRequestFieldSnippet(Type requestBodyType, boolean failOnUndocumentedFields); JacksonRequestFieldSnippet requestBodyAsType(Type requestBodyType); JacksonRequestFieldSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields); @Override String getHeaderKey(Operation operation); @Override boolean isMergeable();  }
@Test public void failOnUndocumentedFields() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("addItem", Item.class); thrown.expect(SnippetException.class); thrown.expectMessage("Following request fields were not documented: [field1, field2]"); new JacksonRequestFieldSnippet().failOnUndocumentedFields(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(ObjectMapper.class.getName(), mapper) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }